# Updating a branch.

4 messages from 2009-10-22 to 2009-10-28. Participants: elyod72, Avery Pennarun, Tim Henigan, Tim Mazid.
Thread: https://gitlist.dev/t/21328

## elyod72, 2009-10-22 19:21

Subject: Updating a branch.
Message-ID: <26015707.post@talk.nabble.com>
URL: https://gitlist.dev/e/26015707.post%40talk.nabble.com

```

I am a newbie to git, so please bear with me.
Here is the scenario that I am struggling with:

I have my Master branch.
I then create a new branch named Test.
I then make changes and additions to the test branch. 
At the same time I make changes to the Master branch.
Now I want to update the Test branch with the latest information from the
Master branch. 

How do I go about doing that?

Thanks for you time and help.
-- 
View this message in context: http://www.nabble.com/Updating-a-branch.-tp26015707p26015707.html
Sent from the git mailing list archive at Nabble.com.

```

## Avery Pennarun, 2009-10-22 19:26

Subject: Re: Updating a branch.
Message-ID: <32541b130910221226t78f27976t69d0093aa7ba417c@mail.gmail.com>
URL: https://gitlist.dev/e/32541b130910221226t78f27976t69d0093aa7ba417c%40mail.gmail.com
In-Reply-To: <26015707.post@talk.nabble.com>

```
On Thu, Oct 22, 2009 at 3:21 PM, elyod72 <elyod72@gmail.com> wrote:
> I have my Master branch.
> I then create a new branch named Test.
> I then make changes and additions to the test branch.
> At the same time I make changes to the Master branch.
> Now I want to update the Test branch with the latest information from the
> Master branch.
>
> How do I go about doing that?

git checkout Test
git merge Master

```

## Tim Henigan, 2009-10-22 20:31

Subject: Re: Updating a branch.
Message-ID: <32c343770910221331q2b419d7dvc5c89ab3864348ca@mail.gmail.com>
URL: https://gitlist.dev/e/32c343770910221331q2b419d7dvc5c89ab3864348ca%40mail.gmail.com
In-Reply-To: <26015707.post@talk.nabble.com>

```
On Thu, Oct 22, 2009 at 3:21 PM, elyod72 <elyod72@gmail.com> wrote:
>
> I am a newbie to git, so please bear with me.
> Here is the scenario that I am struggling with:
>
> I have my Master branch.
> I then create a new branch named Test.
> I then make changes and additions to the test branch.
> At the same time I make changes to the Master branch.
> Now I want to update the Test branch with the latest information from the
> Master branch.
>
> How do I go about doing that?

In general, the following is recommended:
  1) If possible, complete your work on the Test branch without merging
     the changes.  Save your merge (and any potential conflict resolution)
     for when the Test branch is complete and fully tested.
  2) If Test absolutely requires the changes made in Master, then perform
     a "git rebase master" from your Test branch.  This operation replays
     the commits you have made to Test on top of your latest commit to
     Master.

See the gitworkflows man page [1] for further information.  The section on
"Topic Branches" should be helpful.

This post [2] on StackOverflow has some helpful info as well.

-Tim

[1] http://www.kernel.org/pub/software/scm/git/docs/gitworkflows.html
[2] http://stackoverflow.com/questions/457927/git-workflow-and-rebase-vs-merge-questions

```

## Tim Mazid, 2009-10-28 12:03

Subject: Re: Updating a branch.
Message-ID: <26093449.post@talk.nabble.com>
URL: https://gitlist.dev/e/26093449.post%40talk.nabble.com
In-Reply-To: <26015707.post@talk.nabble.com>

```


elyod72 wrote:
> 
> I am a newbie to git, so please bear with me.
> Here is the scenario that I am struggling with:
> 
> I have my Master branch.
> I then create a new branch named Test.
> I then make changes and additions to the test branch. 
> At the same time I make changes to the Master branch.
> Now I want to update the Test branch with the latest information from the
> Master branch. 
> 
> How do I go about doing that?
> 
> Thanks for you time and help.
> 


I'm a newbie too, don't worry. :P

And what you're describing is pretty simple.
Just do

git checkout Test
git merge Master

Voila. :P
Obviously, if there are any conflicts, you'll have to resolve them with 'git
mergetool'.

Good luck,
Tim.
-- 
View this message in context: http://www.nabble.com/Updating-a-branch.-tp26015707p26093449.html
Sent from the git mailing list archive at Nabble.com.

```
