git建立分支並推送到遠端分支
阿新 • • 發佈:2018-12-21
首先,先檢視自己所在分支上是否有沒有上傳的修改處:git branch;如若沒有,則直接可以建立並且換到所建立的分支目錄。
GIT建立分支以及上傳伺服器 git checkout -b xxxxxx 檢視分支:git branch 1,建立+切換分支:git checkout -b xxxxxx 2,合併某分支到當前分支:git merge xxxxxx 3,刪除分支:git branch -d xxxxxx 4,上傳伺服器:git push origin xxxxxx:xxxxxx 主要的還是操作1和4步 推送本地分支local_branch到遠端分支 remote_branch並建立關聯關係 a.遠端已有remote_branch分支並且已經關聯本地分支local_branch且本地已經切換到local_branch git push b.遠端已有remote_branch分支但未關聯本地分支local_branch且本地已經切換到local_branch git push -u origin/remote_branch c.遠端沒有有remote_branch分支並,本地已經切換到local_branch git push origin local_branch:remote_branch