《window phpstorm和linux上如何安裝github項目分支》要點:
本文介紹了window phpstorm和linux上如何安裝github項目分支,希望對您有用。如果有疑問,可以聯系我們。
相關主題:PHP開發
可以先在github上查看其分支:
如上,就是beta分支
可以在命令行中查看:
[root@iZuf67dbc4yqp padchat-php]# git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/beta
remotes/origin/master
或者:
[root@iZuf67dbc4yqp padchat-php]# git branch -r
origin/HEAD -> origin/master
origin/beta
origin/master
查看所有分支:
# 默認有了dev和master分支,所以會看到如下三個分支
# master[本地主分支] origin/master[遠程主分支] origin/dev[遠程開發分支]
# 新克隆下來的代碼默認master和origin/master是關聯的,也就是他們的代碼保持同步
拉取分支:
# git checkout -b origin/beta
有時你修改了本地文件,在拉取分支時,出現提示:
[root@iZuf67dbc4yqp padchat-php]# git checkout -b origin/beta
error: You have local changes to 'app/Bootstrap.php'; cannot switch branches.
提示說 本地文件app/Bootstrap.php有改動 不能進行切換分支
備份并刪除提示的文件 ,用git checkout 進行恢復文件,再切換分支 對文件進行修改
在window上,可以用phpstorm拉取分支
在phpstorm的菜單“VCS--git---pull”中拉取即可。