Skip to content

Instantly share code, notes, and snippets.

@guenhter
Created October 13, 2017 05:24
Show Gist options
  • Save guenhter/1d017dfc760e22f55a131759320d8526 to your computer and use it in GitHub Desktop.
Save guenhter/1d017dfc760e22f55a131759320d8526 to your computer and use it in GitHub Desktop.
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
git config user.email "[email protected]"
git config user.name "guenhter"
git config user.email "[email protected]"
git config user.name "guenthgr"
git config --global push.default simple
git config --global fetch.prune true
# allow self signed certificates - DON'T USE THIS IF POSSIBLE
git config --global http.sslVerify false
git diff --staged # get changes between staging area and repo
git branch -u origin/master # set remote tracking
git remote show [remote-name] # inspecting a remote repo
git tag -a v1.0 -m 'my version 1.0' # Create annotated tag
git log --pretty=oneline
git log --oneline --decorate --graph --all
git show v1.0
git reset --hard HEAD
get merge --abort
git push origin --delete serverfix
git fetch/pull --prune
#### Cleanup branches
Remove all old tags
git tag -l | grep temp
git tag -d list-of-tags
# Delete all temp-* tags of all subdirs
for d in $(ls -d */); do git -C $d tag -l | grep temp | xargs git -C $d tag -d; done
^((?!weeks).)*[^.|/]$
# create tags for every branch
git tag temp-publish-all-libs origin/publish-all-libs
# Delete remote and local branch
git branch -d publish-all-libs
git push origin --delete publish-all-libs
# push the tags to the central repo
git push origin --tags
for d in $(ls -d */); do git -C $d push origin --tags; done
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
git config user.email "[email protected]"
git config user.name "guenhter"
git config user.email "[email protected]"
git config user.name "guenthgr"
git config --global push.default simple
git config --global fetch.prune true
# allow self signed certificates - DON'T USE THIS IF POSSIBLE
git config --global http.sslVerify false
git diff --staged # get changes between staging area and repo
git branch -u origin/master # set remote tracking
git remote show [remote-name] # inspecting a remote repo
git tag -a v1.0 -m 'my version 1.0' # Create annotated tag
git log --pretty=oneline
git log --oneline --decorate --graph --all
git show v1.0
git reset --hard HEAD
get merge --abort
git push origin --delete serverfix
git fetch/pull --prune
#### Cleanup branches
Remove all old tags
git tag -l | grep temp
git tag -d list-of-tags
# Delete all temp-* tags of all subdirs
for d in $(ls -d */); do git -C $d tag -l | grep temp | xargs git -C $d tag -d; done
^((?!weeks).)*[^.|/]$
# create tags for every branch
git tag temp-publish-all-libs origin/publish-all-libs
# Delete remote and local branch
git branch -d publish-all-libs
git push origin --delete publish-all-libs
# push the tags to the central repo
git push origin --tags
for d in $(ls -d */); do git -C $d push origin --tags; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment