merge a git branch into master

git 開分支很快,透過 git branch 就可以了,切換 local 和 server 上的  branch 是使用 git checkout, 有分支總有一天會需要匯回master, 合併的指令如下:


git checkout master
git pull origin master
git merge test
git push origin master

If I have a local branch from a remote one, I don’t feel comfortable with merging other branches than this one with the remote. Also I would not push my changes, until I’m happy with what I want to push and also I wouldn’t push things at all, that are only for me and my local repository. In your description it seems, that test is only for you? So no reason to publish it.

git always tries to respect yours and others changes, and so will --rebase. I don’t think I can explain it appropriately, so have a look at the Git book – Rebasing or git-ready: Intro into rebasingfor a little description. It’s a quite cool feature

 

 

相關文章:

Git 分支 – 分支的新建與合併
https://git-scm.com/book/zh-tw/v1/Git-%E5%88%86%E6%94%AF-%E5%88%86%E6%94%AF%E7%9A%84%E6%96%B0%E5%BB%BA%E8%88%87%E5%90%88%E4%BD%B5

解決合併的衝突
https://backlogtool.com/git-tutorial/tw/stepup/stepup2_7.html

How do I update a GitHub forked repository? 同步分出來的分支
http://max-everyday.com/2017/01/how-do-i-update-a-github-forked-repository/

Facebook網友回應

您可能也會感興趣的文章...

獅尾蝙蝠圓體:思源黑體筆觸長耳朵和拔腳改造免費商用

電腦相關應用

獅尾蝙蝠圓體基於思源黑體筆觸長耳朵和拔腳改造,更加簡明現代化的字體。支援简体中文、繁體中文、韓文與日文;歡迎大家自由應用、自由改作! 獅尾三角黑體的特色是,「一」字的開頭 […]

Read More

Hola Free VPN Proxy Unblocker

電腦相關應用

前陣子在偷別人家資料庫的內容,三不五時就被擋下來,真心感謝 Hola Free VPN 幫我到別人的網站裡搬出 12,914筆資料,搬出的成果: 查「部首」、「筆畫」、「 […]

Read More

只喝了二口的紅茶

電腦相關應用

吃早餐的時候,有4個高中生坐在我對面桌,他們走掉時,3杯紅茶還很滿,1杯豆漿還有一半,這家阿根早餐店的紅茶,還滿多客人點的,他們走掉時候我發現他們飲料還剩很多,應該不難喝 […]

Read More

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *