All Questions
20 questions
2
votes
2
answers
99
views
Using git autobackup with shell script
I have php website for prevent hacker modify any file and inject backdoor.
I want to use git as a file tracking solution. This is my shell script:
...
-2
votes
1
answer
147
views
Write portable Git aliases
The following aliases return all the same number of results, on my Cygwin (on Windows):
...
6
votes
1
answer
223
views
Pre-commit hook to prevent large file commits
I've written the below bash script to run as a pre-commit hook. The intention is to check the git staging area for any files larger than 1mb, and prevent the commit if any are present.
...
3
votes
2
answers
397
views
bash wrapper around 'git commit' to automatically bump (Python) package CalVer and create matching CalVer tag on new commit
I'm doing a lot of Python development lately for various (small-)data analysis pipelines at work. I've been wrestling with how to robustly and ~automatically version the code at a fine-grained level, ...
5
votes
1
answer
908
views
Git hook to detect existing tag case insensitive
In my company, we use git as VCS, the main server run under linux but all our code is for Windows and we all develop on Windows.
The git tag system is case sensitive on linux but is case insensitive ...
2
votes
1
answer
265
views
Commit the working directory to different branch and switch back
The aim of this script is to snapshot the current working directory of a git repository to another branch. Afterwards, it switches back to the original branch and restores the original state, ...
13
votes
5
answers
3k
views
Git delete all merged in local branches
I have written a shell script utility for deleting all merged local branches.
...
3
votes
1
answer
1k
views
Reset files in Git which show as modified but have no changes according to “git diff”
This seems to be working but also is quite horrendously slow and seems a little hacky to me.
...
3
votes
0
answers
259
views
Colorized zsh prompt with support for Virtualenv and Git
I took the agnoster theme and re-wrote it to this:
...
1
vote
1
answer
84
views
Script to execute arbitrary command on each Git project in a directory
The idea is simple, most people have some one directory containing all their projects as subdirectories. When you are in the top directory and you run this script like so ...
3
votes
1
answer
379
views
POSIX shell script using a string to store command arguments
Background
I’ve started putting all my configuration files (which include many shell files) under version control. In the Git repository, I’ve configured a pre-commit hook that runs the ...
2
votes
1
answer
244
views
Git post-receive hook writen as a POSIX shell script (utilising a named pipe)
This is my first piece of code to post here. I wrote this script as a
post-receive hook for a Git repository but I’m not so concerned with the Git
parts (I’d like to have the part marked with ...
5
votes
1
answer
3k
views
Git merge script
The branches I need to merge are called test and test-passed. Merging will always be fast-forward, from test to test-passed as commits to test-passed are only done automatically from test. This is ...
13
votes
1
answer
11k
views
Clone GitHub repository using Python
I want to backup my GitHub repositories since there is news about blocking GitHub in India. I wrote Python code to automate this and would like for it to be reviewed.
...
5
votes
2
answers
496
views
Team git commit cleaner
I cleaned a big repository for my team with this Python code. My goal was for every developer in my team to check if some bad email are in the commit, and replace the information by the good one. I ...