How to rebase from parent branch?

3250 views git
5

Below is the current scenario of branch X & Y in Git:

   A - B [origin/master]
     \
      C - D - G - H [origin/X]
           \
            E - F [Y]

where,

developer1 is working on branch X

and

am working on branch Y.

X is parent branch of Y.


Currently branch Y is pointing remotely to origin/Y

I want to include changes of origin/X in branch Y before working further on branch Y. So, I would like to see, something like:

A - B [origin/master]
     \
      C - D - G - H [origin/X]
                   \
                    E1 - F1 [Y]

1) What are the git commands for rebasing my branch Y?

2) What does this command(git branch -u origin/X Y) do?

answered question
Add a Comment

1 Answer

3

It's simple:

git checkout Y
git rebase origin/X

posted this

Please login first before posting an answer.

Ads

Categories