Github New Repository

  1. 申請github帳號
  2. create a empty public repository
  3. 在欲上傳的folder執行以下指令

    1
    2
    3
    4
    5
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin https://github.com/cwza/gms.git
    git push -u origin master
  4. .gitignore筆記參考

  5. git筆記參考

  6. fetch remote branch and checkout it

    1
    2
    git fetch <remote> <rbranch>:<lbranch>
    git checkout <lbranch>

Update Github forked repository

1
2
3
4
5
6
7
git remote -v
git remote add upstream https://github.com/otheruser/repo.git
git fetch upstream
git branch -va
git checkout master
git merge upstream/master
git push