Skip to content
Dongwook Lee edited this page Jun 3, 2013 · 3 revisions

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가 아니라며 에러 발생
Clone this wiki locally