11. git push - nephilim/js-git-kata GitHub Wiki
Git Push
-
push vs fetch
- By default (see documentation of push.default config variable) you push matching branches, which means that first you have to do git push origin branch for git to push it always on git push.
- With modern git you always fetch all branches (as remote-tracking branches into refs/remotes/origin/* namespace, visible with git branch -r or git remote show origin).
-
git push
- ํน์ด ์ฌํญ ์์ด ๋์ํ๋ฉด
-
git push -u
- upstream: the main repo that other people will be pulling from
- git push/pull(์ธ์ ์์)์ ๊ธฐ๋ฐ์ด ๋๋ค
-
git push -n -v
-n
: simulate the git push result so you can see in advance which branch(es) will be affected.
-
config push
- git config --add remote.origin.push 'refs/heads/:refs/heads/'
Track Branch
- git remote show origin
-
git branch -avv
Track Branch
- git remote show origin
Remote Branches
- git remote show
- git branch -r
- git checkeout -t
- remote์ ์๋ก ์๊ธด ๋ธ๋์น(local์ ์์)๋ฅผ ๊ฐ์ ธ์ฌ ๋
git checkout -t origin/feature origin/feature
- creates and checks out "feature" branch that tracks "origin/feature"
Tracking Branch
- link
- ์ค์ต
- local์ ๋จผ์ ๋ง๋ ์ ์ฅ์๋ฅผ github์ ์ฌ๋ฆผ
- git remote add ํ
- origin/master ์ master๊ฐ tracking ๊ด๊ณ๊ฐ ์๋
- ์์ ํ push ํ๋ ค๋ฉด server side์ master๊ฐ fast-foward๊ฐ ์๋๋ผ๋ฉฐ ์๋ฌ ๋ฐ์