[git-users] How to avoid merge conflicts while merging INT changes into Master

2017-07-10 Thread Anjaiah Yamagani
Hi Team,

I have very quick question - as I'm new to the git

we have master branch. 

and checked out the INT branch from the master, worked on the INT for an 
month and all the developers pushed the code to INT , obviously INT branch 
ahead of comments then the master.

Now while we try to push the code to the Master it shows conflicts, how to 
avoid this.

at this stage I do not want to see the conflicts and work with the 
developers at this stage and resolve the merge conflicts.

can you suggest are we doing any wrong thing here.

Regards,
Anjaiah

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] Re: Uncommiting a merge?

2017-07-10 Thread Igor Djordjevic
Hi Michael,

On Saturday, July 8, 2017 at 3:03:42 AM UTC+2, Michael Gersten wrote:
>
> So I did a merge, edited the conflicts, and committed the result. Looking 
> over the commit, I saw that I missed a conflict marker. 
>
> No bigger. "git reset head^", fix it up, and re-commit, right?
>

Not really, you could have fixed it up right away (without resetting), and 
"re-commit" with:

(*1*) $ git commit --amend --no-edit

... which is what you actually wanted to do anyway, amend the last (merge) 
commit ;)

No, for some reason, that wants to commit a normal commit, not a merge 
> commit. 
> The second parent is missing. 
>

This is as expected -- with your `git reset HEAD^` you dropped your last 
(merge) commit, returning to previous commit but keeping the uncommited 
changes. By "re-commit", I assume you mean plain `git commit`, and that 
makes a regular, single parent commit, not a merge commit -- Git has no 
idea of your previous merge commit at this point, nor that you want to make 
one now.

How do I make it come back?
>

In your current situation, you can reset again to drop the unwanted 
non-merge commit, and then manually create "MERGE_HEAD" file inside your 
".git" folder, containing the hash of the second parent you want your merge 
commit to contain, for example:

(*2*) $ git reset --soft HEAD^
$ echo *second-parent-sha1* >.git/MERGE_HEAD

With that file present and set, doing `git commit` will make a merge 
commit, setting the second parent as you want it.


But in general case, doing (*1*) as explained above and avoiding 
unnecessary hassle seems more preferable :)

Regards,
Buga

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.