1

The setup of my repositories is like this:

A web server named LIVE
A server acting as central repo with a bare clone from LIVE, named REPO
A test web server named TEST with a clone from REPO (aka the same files as LIVE)
Egit with eclipse for localhost development and debugging.

If i want to add a new feature to my site i thought i can use a workflow like this..
@LIVE: git push #get the latest files from LIVE server to REPO
@eclipse: "fetch from upstream" #get the latest files from REPO to ECLIPSE
now i create a new branch called "mynewfeature" and when i'm done:
@eclipse: "push to upstream" #push the new branch to REPO
@TEST: git fetch
how can i check here which files(only filenames) will change with merge?
How can i check which files are conflicting before merging?

@TEST: git merge origin/mynewfeature #apply my new feature
now if everything is ok i do:
@LIVE: git fetch #get the new feature to LIVE server
@LIVE: git merge origin/mynewfeature

Is this workflow correct?

My major problem now is conflicts.. with SVN if i had a confict durring update i was asked which file i wanted, with git i get an "auto-merge" which breaks my PHP files.
Can i stop auto-merge when merging files?

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
karpa
  • 201
  • 4
  • 17
  • Consider what happens if the first time you do a merge (on TEST), you get merge conflicts that you have to resolve manually. How would this affect the remainder of your workflow? You certainly can't resolve the merge conflicts on LIVE because, well, it's live. – Greg Hewgill Dec 04 '11 at 18:45

1 Answers1

0

Normally what you will do is do the merge on your local development system.

  • pull from REPO
  • branch for mynewfeature
  • develop locally
  • push branch to REPO
  • pull mynewfeature branch to TEST
  • if all goes well...
  • in your development system, merge mynewfeature into master
  • push master to REPO
  • pull master to TEST, do a final check of everything post-merge
  • pull master to LIVE

The only time you're doing a merge here is in your development system. You resolve any conflicts locally using the usual procedure for doing so. After you push the result of the merge back to master, nobody else has to repeat the merge procedure you just did.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
  • doing a merge at localhost sounds good to me, but what if, while i'm developing a file from LIVE, that change? will i get a conflict again? And if i had to resolve the conflict at my local repo wouldn't that conflict re-appear when i make a pull master to LIVE? – karpa Dec 04 '11 at 19:56
  • Yes, you may get merge conflicts if two people change the same part of the same file at the same time. I would recommend a good book such as [Pro Git](http://progit.org) (available for free) which describes all of this in detail. – Greg Hewgill Dec 04 '11 at 20:18
  • Hi Greg, Sorry for the delay.. I checked Pro Git but i stil didnt found the info i was looking for.. Is there an equilavent to "svn status --show-updates" command for git? (look at the bottom http://ldc.usb.ve/docs/svn/svn.ref.svn.c.status.html) This will answer my first questions in bold.. – karpa Dec 09 '11 at 16:39