On Tuesday, 30 September 2014 04:56:40 UTC+2, likage wrote:
> Hi all, I have just started out using Git and I have a couple of 
> questions. Bear with me should the questions sound ridiculous or stupid 
> even...
> Say, in this repo of mine, there are 3 branches - master (main) and 
> develop branche (feature)
> So the contents in both develop01 and develop02 will be merged and pushed 
> into master.
> 1. If someone, lets call this person Mark... He committed and pushed a 
> change (itemE) into master as I stated below:
> Initial Contents:
> master - itemA, itemB, itemC, itemD
> develop - itemA, itemB, itemC, itemD
> New Contents:
> master - itemA, itemB, itemC, itemD, itemE*
> Though I did a git pull, there is no update seeing that develop is not 
> 'touched'. When I tried to make some changes into develop - adding in itemF 
> (comitted and pushed the changes into develop only) 
> The contents are: develop - itemA, itemB, itemC, itemD, itemF
> But as soon as I did a pull request, I was prompted with the warning *This 
> pull request can't be merged. You will need to resolve conflicts to be able 
> to merge* and it asked me to do the following steps:
> git fetch origin master
> git checkout develop 
> git merge FETCH_HEAD
> git commit
> git push origin HEAD
> While I am doing so, in the git status, it is showing itemF as a new file 
> that needs to be committed.
> Thus my question would be, does it means that both the contents/number of 
> items in my master and develop has to be the same?
> 2. Prior to my above question, does this means I will always need to do 
> the steps as I written above, before I can commit my changes into develop?
> 3. What are some of the preparatory steps I should have take before I 
> initiate a pull request? I asked this because though I always did a git 
> pull to update the branch I am working on, but at times if I am prompted 
> with similar or complicated scenarios again, I just feared I may screwed up 
> the overall repo or the initial branch itself. Any advises is appreciated :)

Hey, a pull request is nothing less than a *request to merge*, and as with 
any merge attempt there may be conflicts if the same lines of a file have 
been modified in both branches. If you don't have the possiblity to resolve 
the conflicts when making the pull request, then you can get the conflicts 
and resolve them *before* making the pull request by merging the 
destination branch (in this case *master*) into your local branch (in this 
case *develop*).

For more informations about merge conflicts and how to solve them, have a 
look at Git-SCM book's chapter on merging 
or this nice article about Git merge conflicts on CSS-Tricks 

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.

Reply via email to