[英]git - branching from local repo
I am trying to set up a local repository (LOCAL_REPO) from some git branch (MASTER) which is to be used by a group of people. 我正在尝试从某些git分支(MASTER)建立本地存储库(LOCAL_REPO),该分支将由一群人使用。
MASTER------>LOCAL_REPO MASTER ------> LOCAL_REPO
To do this i did the following : 为此,我做了以下工作:
This creates a branch LOCAL_REPO for me at my local shared directory (SHARED_PATH) 这将在我的本地共享目录(SHARED_PATH)中为我创建一个分支LOCAL_REPO。
Now this LOCAL_REPO is used amon a set of people and any changes that they commit will be to LOCAL_REPO which can be synced with MASTER. 现在,此LOCAL_REPO已用于一组人员,他们提交的任何更改将是LOCAL_REPO,可以与MASTER同步。 So i tried creating local branch(MY_LOCAL) for myself at some path. 所以我尝试在某个路径上为自己创建本地分支(MY_LOCAL)。
I am facing following issues : 我面临以下问题:
Blockquote fatal: git checkout: updating paths is incompatible with switching branches Blockquote致命:git checkout:更新路径与切换分支不兼容
After that i tried "git remote show origin" , this shows me LOCAL_REPO as remote and tracked. 之后,我尝试了“ git remote show origin”,这将LOCAL_REPO显示为远程并已跟踪。 What is the mistake i am doing here ? 我在这里做什么错?
When you're doing a git clone
it will checkout a master
branch by default. 当您执行git clone
时,默认情况下它将签出master
分支。 To specify branch during clone use (in your case) 在克隆使用期间指定分支(针对您的情况)
git clone SHARED_PATH -b LOCAL_REPO
And for your 2nd issue, probably git pull --all
should help 对于第二个问题,可能是git pull --all
都应该有所帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.