vault backup: 2023-01-12 19:45:43
This commit is contained in:
parent
be034057e0
commit
a44dab9704
57
git.md
57
git.md
@ -1,28 +1,29 @@
|
|||||||
|
|
||||||
Branches
|
Branches
|
||||||
============================================
|
============================================
|
||||||
|
|
||||||
|
|
||||||
### Adding Branches
|
### Adding Branches
|
||||||
|
|
||||||
* local: `git checkout -b <branch>`
|
* local: `git checkout -b <branch>`
|
||||||
* remote: `git push --set-upstream <remote> <branch>`
|
* remote: `git push --set-upstream <remote> <branch>`
|
||||||
* track remote: `git checkout --track <origin>/<branch>`
|
* track remote: `git checkout --track <origin>/<branch>`
|
||||||
|
|
||||||
### Deleting Branches
|
### Deleting Branches
|
||||||
|
|
||||||
* local: `git branch -d <name>`
|
* local: `git branch -d <name>`
|
||||||
* remote: `git push -d <remote> <name>`
|
* remote: `git push -d <remote> <name>`
|
||||||
* realize remote deletes: `git remote prune <remote>`
|
* realize remote deletes: `git remote prune <remote>`
|
||||||
|
|
||||||
### Non-Standard Activities
|
### Non-Standard Activities
|
||||||
|
|
||||||
* merge only a single file into another branch `git checkout <branch> -- <file>`
|
* merge only a single file into another branch `git checkout <branch> -- <file>`
|
||||||
* delete from repo and file system `git rm <file>`
|
* delete from repo and file system `git rm <file>`
|
||||||
* set current branch to track remote `git branch -u <origin>/<branch>`
|
* set current branch to track remote `git branch -u <origin>/<branch>`
|
||||||
|
|
||||||
Config
|
Config
|
||||||
=============================================
|
=============================================
|
||||||
|
|
||||||
* set line ending behaviour `git config --global core.autocrlf true`
|
* set line ending behaviour `git config --global core.autocrlf true`
|
||||||
* store credentials `git config credential.helper store` or `git config credential.helper cache`
|
this should force git to checkout code using OS default line endings
|
||||||
|
* store credentials `git config credential.helper store` or `git config credential.helper cache`
|
||||||
|
Loading…
Reference in New Issue
Block a user