tags:

views:

50

answers:

2

I'm working on two machines and origin repo on third one (origin is accessible from the other two, no direct connection between machine1 and machine2).

machine1$: git branch

  master
* testing
  cms

machine2$: git branch

* master

Now, I want to push the testing branch to the origin and have it on machine2 too, so the final effect would be:

machine2$: git branch

* testing
  master

I have tried:

machine1$: git push origin testing
machine2$: git pull origin testing # bunch of merge conflicts
machine2$: git checkout -b testing origin/testing # errors too

Current state is:

machine1$: git branch -r

  origin/HEAD -> origin/master
  origin/master
  origin/testing

How to do it?
My next question probably will be: how to delete the origin/testing branch?

+1  A: 

You have successfully pushed the testing branch to origin so now you just need to get the branch to machine2.

Not sure of the state of teh repo on machine2 so I would delete the directory (Or create a new one to use) and just clone the repo on Machine2 and checkout testing ...

So on Machine2 in an empty dir (new or clean):

machine2$: git clone git@github/somwhere
machine2$: git branch
* master
machine2$: git checkout testing
...
something about getting and switching
... 
machine2$: git branch
* testing 
master
abarr
That's what I did. Maybe dirty, but it worked in my case.
takeshin
A: 

Instead of using git pull (which fetches and merges), try git fetch (which won't try to merge with your current branch on machine2, and cause conflicts):

machine1$: git push origin testing
machine2$: git fetch origin testing
machine2$: git checkout -b testing origin/testing
Bruno