Print

Print


Thanks Jeremy,

That should work.

Norman

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

For keeping your actual hps-java installations separate you would probably want to install them into different local Maven repositories with a command line option e.g.

mvn install -DlocalRepository=/work/my-branch-m2repo

Then your distributions would show up in the usual relative location under that dir instead of ~/.m2/repository .

The first time you do this it will take a long time as it downloads all the deps but subsequent builds should go quickly.

This does result in a lot of local duplication of downloaded jars but it will keep your branch installations completely separate from each other.

Hope that answers your question…

—Jeremy

> On Mar 16, 2017, at 3:24 PM, Graf, Norman A. <[log in to unmask]> wrote:
> 
> 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