开发者

How make two repository for singe git working source

I newbie to using git, correct me if I am wrong,

Case : 1

I want to work in single copy but when update (git push filename origin branchname), it needs to update in two repositories.

For example:

I have single working copy which cloned from Main Repo (A).

Now I want to test the working copy, so I need to update the file to Testing Repo (B) (which needs to be Repo- so that other will get clone) after testing I need to move it again to the Main Repo (A) by doing git pull from Repo(B) to my working copy (local) and git push to Repo(A)

Case : 2

I pulled a file (somefile.txt-which is modified in repo) from Repo(A) and I also changed the same file (somefile.txt) in my local, Whe开发者_如何学运维n I git pull, that time it'll show error like "aborting due to changes in file , First commit your changes"

For that basically, I do first checkout the file and add my changes to the file and I add commited it.

But what I want is "How to merge the same file in single command" and do this ll messed up the code ?

Thanks, Jak.


If remote repositories "repoA" and "repoB" represent the same set of files (with slightly different content for testing purposes), then I would argue you don't need two repos.

You can more easily update a file in two branches (one for dev, one for test), and push your repo to a unique remote repo (than trying to manage two push to two different repositories).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜