-
Notifications
You must be signed in to change notification settings - Fork 35
Git cheat sheet
CSEMike edited this page Feb 20, 2011
·
3 revisions
###Check status:
git status
###Create branch:
git checkout -b <new branch name>
###Show active branch and list of other branches:
git branch
git add <path to file>
git commit -a
git push origin <branch name>
###switch to an existing branch
git checkout <branch name>
- make sure you are in master:
git branch
(check for the *)
- if not in master, switch to master:
git checkout master
- merge:
git merge <name of branch to merge into master>
git push origin
###delete a local branch
git branch -d <branch name>
###delete a branch at the central repo (remember to put a : in front of the branch name!)
git push origin :<branch name>
git rm --cached file
git rm file
git checkout --ours file
git checkout --theirs file