2

I have two branches, Master and Develop. I will like to "copy" the content of Develop in Master so:

Master <- Develop

According to documentation:

git rebase <base>

Rebase the current branch onto base, which can be any kind of commit reference (an ID, a branch name, a tag, or a relative reference to HEAD).

But Im not very sure about the terminology, if I check out to Master and from there i do git rebase develop am I coping everything from develop to master or the other way?

DomingoSL
  • 14,920
  • 24
  • 99
  • 173
  • 1
    think of it like this: everything you do in git is done on your active branch -- rebase is no different. – northben Oct 21 '14 at 18:45

1 Answers1

1

git rebase X means:

move the commits of the current branch on top of branch X.

In your case:

git checkout Develop
git rebase master

But if you don't want to change the history of Develop (for instance, if Develop was already pushed to a remote repo), a simple git merge is enough.

git checkout master
git merge Develop
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I usually do a Merge, but I have a conflict in one file i can figure out how to fix, i had one commit on master that is conflicting with develop, so I think doing a rebase will do the trick right? – DomingoSL Oct 21 '14 at 18:38
  • @DomingoSL a rebase will re-apply your commits one by one, and you should still get the conflict. Do you want master to reflect the content of Develop (override)? – VonC Oct 21 '14 at 18:39
  • Im not very sure, i will like to fix the conflict so I can do the merge master<-develop, but then again I dont know how to fix it, i read that pushing the file with the conflict fix the problem but still the conflict continues. – DomingoSL Oct 21 '14 at 18:41
  • @DomingoSL there no way around a conflict: you need to resolve it (and your merge is enough: if the Develop branch was already pushed before, a rebase isn't recommended). So: http://stackoverflow.com/q/161813/6309 – VonC Oct 21 '14 at 18:42
  • I tried to follow the solutions on that post but yet no fix, mainly because im using Windows, can you please take a look here http://stackoverflow.com/questions/26494771/solving-conflicts-on-merge-deleted-and-modified ? Thanks! – DomingoSL Oct 21 '14 at 19:31