2018-05-21 11:55:41 -04:00
|
|
|
|
|
|
|
Branches
|
|
|
|
============================================
|
|
|
|
|
|
|
|
|
|
|
|
### Adding Branches ###
|
|
|
|
* local: `git checkout -b <branch>`
|
|
|
|
* remote: `git push --set-upstream <remote> <branch>`
|
|
|
|
* track remote: `git checkout --track <origin>/<branch>`
|
|
|
|
|
|
|
|
### Deleting Branches ###
|
|
|
|
|
|
|
|
* local: `git branch -d <name>`
|
|
|
|
* remote: `git push -d <remote> <name>`
|
|
|
|
* realize remote deletes: `git remote prune <remote>`
|
|
|
|
|
|
|
|
### Non-Standard Activities ###
|
|
|
|
|
|
|
|
* merge only a single file into another branch `git checkout <branch> -- <file>`
|
2018-05-31 09:12:07 -04:00
|
|
|
* delete from repo and file system `git rm <file>`
|
|
|
|
* set current branch to track remote `git branch -u <origin>/<branch>`
|