# Wrong code on master

4 messages from 2011-12-24 to 2011-12-24. Participants: Jonathan Duncan, Frans Klaver, Nathan W. Panike.
Thread: https://gitlist.dev/t/29244

## Jonathan Duncan, 2011-12-24 05:09

Subject: Wrong code on master
Message-ID: <36BFCDA4-8249-4965-877F-FFC9EA65C7EE@memoryties.com>
URL: https://gitlist.dev/e/36BFCDA4-8249-4965-877F-FFC9EA65C7EE%40memoryties.com

```
I have a developer that committed code that should have been on a branch.  I have created a branch now and locally my master branch is good to go.  However, when I try to push it conflicts, of course, because the repo still wants me to pull the changes and merge them to my master.

The new code from the other developer will eventually be used, but we were not ready for it to be on "master" yet.  I need to push my own code out before that other code gets used.

Will I really have to pull and merge the code to master and then revert?  I have been googling all day, trying to figure out the best way to do this and in the process I fear I have made a mess of my repo.  I have been using git long enough to be dangerous to myself.

Any thoughts?  Got a good article I can read?

Thanks,
Jonathan
```

## Frans Klaver, 2011-12-24 05:49

Subject: Re: Wrong code on master
Message-ID: <op.v6zbsrvi0aolir@keputer>
URL: https://gitlist.dev/e/op.v6zbsrvi0aolir%40keputer
In-Reply-To: <36BFCDA4-8249-4965-877F-FFC9EA65C7EE@memoryties.com>

```
On Sat, 24 Dec 2011 06:09:06 +0100, Jonathan Duncan  
<jonathan@memoryties.com> wrote:

> I have a developer that committed code that should have been on a  
> branch.  I have created a branch now and locally my master branch is  
> good to go.  However, when I try to push it conflicts, of course,  
> because the repo still wants me to pull the changes and merge them to my  
> master.
>
> The new code from the other developer will eventually be used, but we  
> were not ready for it to be on "master" yet.  I need to push my own code  
> out before that other code gets used.
>
> Will I really have to pull and merge the code to master and then  
> revert?  I have been googling all day, trying to figure out the best way  
> to do this and in the process I fear I have made a mess of my repo.  I  
> have been using git long enough to be dangerous to myself.

Well, the proper way is to revert the commits. That won't result in all  
other developers having to deal with a force-updated branch. If you can  
deal with it you can always

$ git push origin +branch

but I wouldn't consider that a nice thing to do.

```

## Jonathan Duncan, 2011-12-24 06:37

Subject: Re: Wrong code on master
Message-ID: <354A93E2-42C7-423D-BE99-1FDCF511741A@memoryties.com>
URL: https://gitlist.dev/e/354A93E2-42C7-423D-BE99-1FDCF511741A%40memoryties.com
In-Reply-To: <op.v6zbsrvi0aolir@keputer>

```

On 23 Dec 2011, at 22:49, Frans Klaver wrote:

> Well, the proper way is to revert the commits. That won't result in all other developers having to deal with a force-updated branch. If you can deal with it you can always
> 
> $ git push origin +branch
> 
> but I wouldn't consider that a nice thing to do.

Good information, thank you.  I think I will mark this as a good learning experience for me.  I will make it a point to inform all my team members to work from branches until we are ready for merging to the master branch.
```

## Nathan W. Panike, 2011-12-24 15:42

Subject: Re: Wrong code on master
Message-ID: <CAPRoxBXVeK25H2SfE4WxhN0h0EyHViQYt=+W_3SdhDqi4jqRHg@mail.gmail.com>
URL: https://gitlist.dev/e/CAPRoxBXVeK25H2SfE4WxhN0h0EyHViQYt%3D%2BW_3SdhDqi4jqRHg%40mail.gmail.com
In-Reply-To: <36BFCDA4-8249-4965-877F-FFC9EA65C7EE@memoryties.com>

```
On Fri, Dec 23, 2011 at 11:09 PM, Jonathan Duncan
<jonathan@memoryties.com> wrote:
> I have a developer that committed code that should have been on a branch.  I have created a branch now and locally my master branch is good to go.  However, when I try to push it conflicts, of course, because the repo still wants me to pull the changes and merge them to my master.
>
> The new code from the other developer will eventually be used, but we were not ready for it to be on "master" yet.  I need to push my own code out before that other code gets used.
>
> Will I really have to pull and merge the code to master and then revert?  I have been googling all day, trying to figure out the best way to do this and in the process I fear I have made a mess of my repo.  I have been using git long enough to be dangerous to myself.
>
> Any thoughts?  Got a good article I can read?

I have found this helpful:

http://thread.gmane.org/gmane.comp.version-control.git/77196/focus=77273

>
> Thanks,
> Jonathan--
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Nathan Panike

```
