开发者

Git Track Branch

I have a repository with one branch called testing and on the server I want to have 2 separate folders - one that pulls from the master branch (git pull origin master) and the other pulls from the testing branch (g开发者_C百科it pull origin testing ? )

Whats the best way to set this up - I tried this and got an error saying that the remote branch is not tracked. I am pretty new to git so not really sure how to set this up?

The idea is to work on the testing branch and then once a week merge it into the master.


If I understand correctly, you want two clones of the repository on the server, one setup to track your local master branch, and the other your local testing branch?

On the server, clone your repo and rename the directory master. This will be your master directory, and it's already configured to fetch and merge from origin/master on a pull

Next, make a copy of the master directory called testing. In that directory, create a branch called testing and tell it to track origin/testing:

git branch --track testing origin/testing
git checkout testing

That should be it. The master and testing directories will fetch and merge origin/master and origin/testing respectively.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜