git

Git 筆記

Posted by blueskyson on March 28, 2021

在本地創建一個 branch 並推送到遠端

假設我要新增一個叫 v0.1 的 branch

$ git branch v0.1
$ git branch
* master
  v0.1
$ git checkout v0.1
Switched to branch 'v0.1'
$ git branch
  master
* v0.1
$ git push -u origin v0.1
$ git branch -a
  master
* v0.1
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/v0.1

將 fork 下來的 repository 更新到主 repository 的進度

$ git remote add upstream ORIGINAL_REPOSITORY_URL
$ git fetch upstream
$ git merge upstream/master
$ git push origin master