Skip to main content
edited tags
Link
aynber
  • 23k
  • 9
  • 53
  • 66
added 216 characters in body
Source Link
jack_the_beast
  • 1.9k
  • 6
  • 35
  • 76

I had the following situation:

-----O
     |
   master
   branch1

then I had to make some changes to master:

 -----O-----O-----O
      |           |
   branch1      master

now I want branch1 to be at the same point of master (and therefore to contain the commits I made):

-----O-----O-----O
                 |
               master
               branch1

I don't know if a merge would be the correct way to achieve this. what steps should I take?

EDIT: also consider that I have uncommitted changes that should be committed on branch1 after branch1 is up to date with master. so I need the current changes to be left untouched to be committed later on branch1

I had the following situation:

-----O
     |
   master
   branch1

then I had to make some changes to master:

 -----O-----O-----O
      |           |
   branch1      master

now I want branch1 to be at the same point of master (and therefore to contain the commits I made):

-----O-----O-----O
                 |
               master
               branch1

I don't know if a merge would be the correct way to achieve this. what steps should I take?

I had the following situation:

-----O
     |
   master
   branch1

then I had to make some changes to master:

 -----O-----O-----O
      |           |
   branch1      master

now I want branch1 to be at the same point of master (and therefore to contain the commits I made):

-----O-----O-----O
                 |
               master
               branch1

I don't know if a merge would be the correct way to achieve this. what steps should I take?

EDIT: also consider that I have uncommitted changes that should be committed on branch1 after branch1 is up to date with master. so I need the current changes to be left untouched to be committed later on branch1

Source Link
jack_the_beast
  • 1.9k
  • 6
  • 35
  • 76

Git: move a branch to make it point to another

I had the following situation:

-----O
     |
   master
   branch1

then I had to make some changes to master:

 -----O-----O-----O
      |           |
   branch1      master

now I want branch1 to be at the same point of master (and therefore to contain the commits I made):

-----O-----O-----O
                 |
               master
               branch1

I don't know if a merge would be the correct way to achieve this. what steps should I take?