How to merge Git of a pushed copy of a branch

I did this:

cd /repo1
git clone <remote-repo>
git checkout -b mynewbranch
<edit1>
git add
git commit
<edit2>
git add
git commit

cd /repo2
git clone <remote-repo>

cd /repo1
git checkout master
git merge mynewbranch
# messages
# All merged Ok.

git checkout mynewbranch
git push /repo2 mynewbranch:mynewbranch

cd /repo2
git branch
* master
  mynewbranch
git merge mynewbranch
# Tons of merge conflict errors

      

The repo1 and repo2 directories contain clones of the same version and code branch. git branch -r

says the same thing in both directories.

Merging my branch into repo1 works fine. But when I push that branch on repo2 and try to do the same merge, I get merge conflicts.

What am I missing? Can this be done correctly?

+3
git


source to share


No one has answered this question yet

Check out similar questions:

20142
How do I undo the last local commits in Git?
15981
How do I delete a Git branch locally and remotely?
11347
What is the difference between 'git pull' and 'git fetch'?
8423
How do I undo 'git add' before committing?
7919
How do I rename my local Git branch?
7159
How do I revert the Git repository to a previous commit?
6334
How do I checkout a remote Git branch?
4541
How to resolve merge conflicts in Git
4105
How do I push my new local branch to a remote Git repository and track it?
3596
Revert a Git merge that hasn't been pushed yet



All Articles
Loading...
X
Show
Funny
Dev
Pics