Reputation: 141
I have two computers A and B, and use git sync some files, init.el for example.
A's repos is hosted on unfuddle. B's repos is locally.
The question is: how to merge A's changes into B's and push the final init.el into unfuddle (A), without expanding A's all file in B.
Or there is a better solution?
Thanks.
Upvotes: 4
Views: 4194
Reputation: 129526
If A and B are totally unrelated (as you say "A's files are not be aware of B's files and vice versa") then you don't need to merge them. Just push A and B and don't merge them.
If you want more separation, create another repository to house the work in B. Use unfuddle to allow/disallow access.
Upvotes: 0
Reputation: 35131
So, if you do not want to pull the files that modified at A
, you can do like this:
At B
, create a new branch and push it to remote service(unfuddle, as you said):
cd path/to/init.el
git branch featureModifiedInB
git checkout featureModifiedInB
git push origin featureModifiedInB
At A
, pull the update of branch that created at B
, manage the merge & conflict:
cd path/to/init.el
git pull origin featureModifiedInB // Or you can do fetch and manually do merging.
git checkout master
git merge featureModifiedInB
// After solve the conflict if it exists.
git push origin master
It makes sure that person using B
can not see the files that edited by person who uses A
. But this'll cause a problem: pB cannot get feedback about the code s/he created. But pA can also modify the featureModifiedInB
branch and let it pulled by pB(mum..it's a little bit troublesome..).
Upvotes: 2
Reputation: 14678
There are a few options:
git push -f origin master
. Note that forcing a push will cause some issues for anyone who branched from you and wants to merge.Upvotes: 0