Git cheatsheet

Ignore permissions

git config core.fileMode false

list branch

git branch

rename branch

git branch -m <newname>

move to another branch

git checkout your-branch

hard reset branch

git reset --hard origin/master

create new branch

git checkout -b new-branch

delete local branch

git branch -D your-branch

merge from develop to master

git merge develop

init on existed project and push master for the first time

git init
git remote add origin ssh://git@bitbucket.org/your-username/your-repo.git
git add .
git commit -am "initial commit"
git push -u origin master

Leave a Comment