- Remember to save and git add, git commit before doing further operations
-
upload
git add . git commit -m "your comments" git push
-
download
git checkout <branch> git fetch git merge
-
new branch
git checkout -b <branch>
-
switch branch
git checkout <branch>
-
delete a local branch
git branch -d <branch> # for merged branches git branch -D <branch> # force deleting
-
delete a remote branch
git push origin --delete <remote branch>
-
merge branch
git merge <branch to be merged>
-
bring back deleted files
git checkout <PREVIUS COMMIT> -- . git add . git commit -m "Restore all deleted files"