-
-
Save tspng/e63c44d3ee43a810f612 to your computer and use it in GitHub Desktop.
Revisions
-
Chris McCoy revised this gist
Dec 23, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # cherry pick range of commits, starting from the tip of 'master', into 'preview' branch git rev-list --reverse --topo-order master... | while read rev; do git checkout preview; git cherry-pick $rev || break; done # create tracking branches for all remote branches git branch -a | grep -v HEAD | perl -ne 'chomp($_); s|^\*?\s*||; if (m|(.+)/(.+)| && not $d{$2}) {print qq(git branch --track $2 $1/$2\n)} else {$d{$_}=1}' | csh -xfs; -
Chris McCoy revised this gist
Dec 23, 2015 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,12 @@ alias g='git' # create tracking branches for all remote branches git branch -a | grep -v HEAD | perl -ne 'chomp($_); s|^\*?\s*||; if (m|(.+)/(.+)| && not $d{$2}) {print qq(git branch --track $2 $1/$2\n)} else {$d{$_}=1}' | csh -xfs; # git reset newly added files for f in `git status | grep new | awk '{print $3}'`; do git reset HEAD $f ; done # git reset newly added files git reset HEAD -- $(git status | awk '/new file:/{print $3}') # pull latest of all submodules git submodule foreach git pull origin master -
Chris McCoy revised this gist
Dec 3, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # create tracking branches for all remote branches git branch -a | grep -v HEAD | perl -ne 'chomp($_); s|^\*?\s*||; if (m|(.+)/(.+)| && not $d{$2}) {print qq(git branch --track $2 $1/$2\n)} else {$d{$_}=1}' | csh -xfs; # pull latest of all submodules git submodule foreach git pull origin master -
Chris McCoy revised this gist
Dec 3, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # pull latest of all submodules git submodule foreach git pull origin master # show a git log with offsets relative to HEAD git log --oneline | nl -v0 | sed 's/^ \+/&HEAD~/' -
Chris McCoy revised this gist
Nov 25, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # show a git log with offsets relative to HEAD git log --oneline | nl -v0 | sed 's/^ \+/&HEAD~/' # list offsets from HEAD with git log o=0; git log --oneline | while read l; do printf "%+9s %s\n" "HEAD~${o}" "$l"; o=$(($o+1)); done | less -
Chris McCoy revised this gist
Nov 25, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # list offsets from HEAD with git log o=0; git log --oneline | while read l; do printf "%+9s %s\n" "HEAD~${o}" "$l"; o=$(($o+1)); done | less # diff the last 2 commits git diff $(git log --pretty=format:%h -2 --reverse | tr "\n" " ") -
Chris McCoy revised this gist
Jul 22, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # diff the last 2 commits git diff $(git log --pretty=format:%h -2 --reverse | tr "\n" " ") # reset the last modified time for each file in a git repo to its last commit time git ls-files | while read file; do echo $file; touch -d $(git log --date=local -1 --format="@%ct" "$file") "$file"; done -
chrismccoy revised this gist
Jul 2, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # reset the last modified time for each file in a git repo to its last commit time git ls-files | while read file; do echo $file; touch -d $(git log --date=local -1 --format="@%ct" "$file") "$file"; done # get author and email of a commit git --no-pager show -s --format='%an <%ae> on %cd' --date=short {commithash} -
chrismccoy revised this gist
May 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ alias g='git' # get author and email of a commit git --no-pager show -s --format='%an <%ae> on %cd' --date=short {commithash} # information about an author by giving it's name or email git log -i -1 --pretty="format:%an <%ae>\n" --author="$1" -
chrismccoy revised this gist
May 30, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # get author and email of a commit git --no-pager show -s --format='%an <%ae>' {commithash} # information about an author by giving it's name or email git log -i -1 --pretty="format:%an <%ae>\n" --author="$1" -
Chris McCoy revised this gist
Mar 3, 2015 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,12 @@ # shortform git commands alias g='git' # information about an author by giving it's name or email git log -i -1 --pretty="format:%an <%ae>\n" --author="$1" # List all files ever existed git log --pretty=format: --name-status $@ | cut -f2- | sort -u # commit all changes git add -A && git commit -av -
Chris McCoy revised this gist
Mar 3, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # commit all changes git add -A && git commit -av # print git commit history git log --oneline --decorate | nl | sort -nr | nl | sort -nr | cut --fields=1,3 | sed 's/([^)]*)\s//g' -
Chris McCoy revised this gist
Feb 7, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,9 @@ alias g='git' # print git commit history git log --oneline --decorate | nl | sort -nr | nl | sort -nr | cut --fields=1,3 | sed 's/([^)]*)\s//g' # print git commit history git log --oneline --decorate | tac | nl | tac | sed 's/([^)]*)\s//g' # find the date of the first commit in a repo git log --pretty=format:'%ad' | tail -1 -
Chris McCoy revised this gist
Feb 7, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # print git commit history git log --oneline --decorate | nl | sort -nr | nl | sort -nr | cut --fields=1,3 | sed 's/([^)]*)\s//g' # find the date of the first commit in a repo git log --pretty=format:'%ad' | tail -1 -
Chris McCoy revised this gist
Feb 5, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # find the date of the first commit in a repo git log --pretty=format:'%ad' | tail -1 # delete all local git branches that have been merged git branch --merged | grep -v "\*" | xargs -n 1 git branch -d -
Chris McCoy revised this gist
Feb 5, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,9 @@ alias g='git' # delete all local git branches that have been merged git branch --merged | grep -v "\*" | xargs -n 1 git branch -d # delete all git branches except master git branch | egrep -v ^master$ | sed 's/^[ *]*//' | sed 's/^/git branch -D /' | bash # delete all git branches except master git branch | grep -v "master" | sed 's/^[ *]*//' | sed 's/^/git branch -D /' | bash -
Chris McCoy revised this gist
Feb 5, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,9 @@ git branch --merged | grep -v "\*" | xargs -n 1 git branch -d # delete all git branches except master git branch | grep -v "master" | sed 's/^[ *]*//' | sed 's/^/git branch -D /' | bash # delete all git branches except master git checkout master; git branch | sed -e '/master/d' -e 's/^/git branch -D /' | bash # export current repo to zip archive git archive -o "${PWD##*/}.zip" HEAD -
Chris McCoy revised this gist
Feb 5, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,9 @@ alias g='git' # delete all local git branches that have been merged git branch --merged | grep -v "\*" | xargs -n 1 git branch -d # delete all git branches except master git branch | grep -v "master" | sed 's/^[ *]*//' | sed 's/^/git branch -D /' | bash # export current repo to zip archive git archive -o "${PWD##*/}.zip" HEAD -
Chris McCoy revised this gist
Jan 25, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # delete all local git branches that have been merged git branch --merged | grep -v "\*" | xargs -n 1 git branch -d # export current repo to zip archive git archive -o "${PWD##*/}.zip" HEAD -
Chris McCoy revised this gist
Nov 26, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,9 @@ alias g='git' # export current repo to zip archive git archive -o "${PWD##*/}.zip" HEAD # figure out what pull requests are in your current branch (staging) but not yet in master git log HEAD...origin/master --pretty=oneline | grep pull # remove missing files git ls-files -d -z | xargs -0 git update-index --remove -
Chris McCoy revised this gist
Nov 18, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,9 @@ alias g='git' # export current repo to zip archive git archive -o "${PWD##*/}.zip" HEAD # remove missing files git ls-files -d -z | xargs -0 git update-index --remove # list authors of a repo git shortlog -sn --all | cut -f2 | cut -f1 -d' ' -
Chris McCoy revised this gist
Nov 18, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,9 @@ alias g='git' # export current repo to zip archive git archive -o "${PWD##*/}.zip" HEAD # list authors of a repo git shortlog -sn --all | cut -f2 | cut -f1 -d' ' # remove file from repo history git filter-branch -f --tree-filter 'rm -rf filename.py' HEAD -
Chris McCoy revised this gist
Nov 18, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ alias g='git' # export current repo to zip archive git archive -o "${PWD##*/}.zip" HEAD # remove file from repo history git filter-branch -f --tree-filter 'rm -rf filename.py' HEAD -
Chris McCoy revised this gist
Nov 18, 2014 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -340,9 +340,6 @@ git diff -U10|dwdiff --diff-input -c|less -R # Better git diff, word delimited and colorized git diff -U10 |wdiff --diff-input -a -n -w $'\e[1;91m' -x $'\e[0m' -y $'\e[1;94m' -z $'\e[0m' |less -R # Count git commits since specific commit git log --pretty=oneline b56b83.. | wc -l -
Chris McCoy revised this gist
Nov 18, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # export current repo to zip archive git archive HEAD --format zip --output "${PWD##*/}.zip" # remove file from repo history git filter-branch -f --tree-filter 'rm -rf filename.py' HEAD -
Chris McCoy revised this gist
Nov 14, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # remove file from repo history git filter-branch -f --tree-filter 'rm -rf filename.py' HEAD # list repos by username curl "https://api.github.com/users/username/repos?type=owner&sort=updated" -s | sed -En 's|"name": "(.+)",|\1|p' | awk '{print $1}' -
Chris McCoy revised this gist
Nov 1, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # list repos by username curl "https://api.github.com/users/username/repos?type=owner&sort=updated" -s | sed -En 's|"name": "(.+)",|\1|p' | awk '{print $1}' # fetch all git remotes for a repo git branch -r | awk -F'/' '{print "git fetch "$1,$2}' | xargs -I {} sh -c {} -
Chris McCoy revised this gist
Oct 31, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # shortform git commands alias g='git' # fetch all git remotes for a repo git branch -r | awk -F'/' '{print "git fetch "$1,$2}' | xargs -I {} sh -c {} # add a tag git tag -a 1.2 -m "Version 1.2 Stable" -
Chris McCoy revised this gist
Oct 15, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,9 @@ alias g='git' # add a tag git tag -a 1.2 -m "Version 1.2 Stable" # show which branches are tracking what git for-each-ref --format='%(refname:short)' refs/heads/* | while read b; do if r=$(git config --get branch.$b.remote); then m=$(git config --get branch.$b.merge); echo "$b -> $r/${m##*/}"; fi; done # push tags git push --tags -
Chris McCoy revised this gist
Sep 8, 2014 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,12 @@ # shortform git commands alias g='git' # add a tag git tag -a 1.2 -m "Version 1.2 Stable" # push tags git push --tags # download all files from a gist without git curl -L https://gist.github.com/username/gistid/download | tar -xvz --strip-components=1
NewerOlder