-
Notifications
You must be signed in to change notification settings - Fork 0
Git
mitochondrion edited this page Jul 28, 2017
·
31 revisions
https://github.com/mitochondrion/dotfiles/blob/master/.gitconfig https://github.com/mitochondrion/dotfiles/blob/master/.gitignore
git bisect start
git bisect good [working commit]
git bisect bad [broken commit]
git bisect [good|bad] # repeat until git finds the first bad commit
git bisect reset
git checkout --ours [FILE]
git checkout --theirs [FILE]
Clean local branches
git branch
git co develop
git branch --merged
git branch -d [MERGED BRANCH TO DELETE]
git branch --no-merged
git branch -D [UN-MERGED BRANCH TO DELETE]
Clean remote branches
git fetch -p (OR git remote prune origin)
git branch -r
git branch -r --merged
git push origin --delete [REMOTE BRANCH TO DELETE]
Merged:
for branch in `git branch -r --merged | grep -v HEAD`; do echo -e `git show --format="%ci %cr %an" $branch | head -n 1` \\t$branch; done | sort -r
Un-merged:
for branch in `git branch -r --no-merged | grep -v HEAD`; do echo -e `git show --format="%ci %cr %an" $branch | head -n 1` \\t$branch; done | sort -r
git filter-branch --index-filter 'git rm --cached --ignore-unmatch Pods/*' --tag-name-filter cat -- --all
git push --force
Move tag:
git fetch -p --tags
git tag -d [tag]
git tag [tag]
git push --tags -f
Latest tag:
git describe --abbrev=0 --tags
Tag of current commit:
git tag -l --points-at HEAD