GIT tricks
GIT tricks
Git commands that are useful, but not used often enough for me to remember them.
Rebase squashing
git rebase -i e417ef2d # commit to the last commit before the ones you want to squashIgnore locally without using gitignore
Add file to .git/info/exclude
Then run
git update-index --assume-unchanged fileBranches
Delete branch
Locally
git branch -d branch-nameRemote
git push -d origin branch-nameReset local branch to origin
git reset --hard origin/masterTags
Delete tag
Locally
git tag -d tagnameRemote
git push --delete origin tagnamePush tags after commit
git push origin --tagsList tags ascending
git tag --sort -v:refname