Print

Print


Thanks Jeremy,

That answers a bunch of questions that I had.

I'm still not completely clear on how I can work on multiple branches at the same time. For instance, I want to be developing the tracking fastmc on one branch. But I also want to maintain a working installation which is kept current with the code being committed by others. A "mvn install" will build a jar file of the same name at the same location, right? It's not a huge deal, but I was wondering if you had any recommendations for best practices.

Norman

-----Original Message-----
From: McCormick, Jeremy I. 
Sent: Thursday, March 16, 2017 3:17 PM
To: Graf, Norman A. <[log in to unmask]>
Cc: hps-software <[log in to unmask]>
Subject: keeping git branches in sync

Hi, Norman.

This is the basic recipe for keeping your branches in sync with master, assuming you are working on the branch ‘my-branch’ …

Checkout your branch:

$ git checkout my-branch

Merge in the current master to your branch:

$ git merge master

If there are conflicts, meaning a file was edited on master that you also have changed, then you resolve the conflicting file by editing it by hand to choose the changes you want to include.  (There are other psuedo-automatic ways of doing this but hand editing is usually the most straightforward.)

Then assuming ‘someFile’ is the file in question you do this to tell git you have resolved the conflict:

$ git add someFile

And then commit the file to your local repo:

$ git commit -m “Resolving conflict in someFile.”

Finally, you push your local branch to github in the usual way:

$ git push

To avoid confusing yourself about what branches will be pushed when you do this, you might want to add this to your ~/.gitconfig file

[push]
	default = current

Hopefully that clears things up for you.  Let me know if you have any questions.

—Jeremy

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1