Table of Contents
git checkout -b <new-branch>
(http://stackoverflow.com/a/1710427/1391441)
git branch -f <branch> origin/<branch>
(http://stackoverflow.com/a/21232996/1391441)
git push --all -u
(http://stackoverflow.com/questions/2003505/delete-a-git-branch-both-locally-and-remotely)
- Remotely
git push origin --delete <branch>
- Locally
git branch -d <branch>
- Force it
git branch -D <branch>
git difftool branch..master
or
git difftool master..branch
(http://stackoverflow.com/questions/822811/showing-which-files-have-changed-between-git-branches)
git diff --name-status master..<branch>
Better
git diff --stat --color master..<branch>
(http://stackoverflow.com/q/27104753/1391441)
git difftool branch1 branch2 file.dat
(http://stackoverflow.com/a/307872/1391441)
Positioned in the branch where I want the file to be copied:
git checkout otherbranch myfile.txt
(http://kevinold.com/2013/04/17/my-git-workflow.html, http://stackoverflow.com/a/9147389/1391441)
git co branch git rebase master git co master git merge branch
(https://gist.github.com/lttlrck/9628955)
git branch -m old_branch new_branch # Rename branch locally git push origin :old_branch # Delete the old branch git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
git tag vx.x.x
git push --tags
(http://stackoverflow.com/a/14075772/1391441)
git checkout .
(http://stackoverflow.com/a/2363495/1391441)
git ls-files -v | grep '^[[:lower:]]'
git config --global alias.acp '!func(){ git add -A && git commit -am "$1" && git push origin master; }; func' git config --global alias.fs '!func(){ git fetch && git status; }; func' git config --global alias.co checkout git config --global alias.ci commit git config --global alias.st status git config --global alias.br branch