3

I'd like to clone a github repo and make a few changes to it. I'd like to submit pull requests to pull those changes to the original repo. All pretty standard stuff.

However, there's one change that I do NOT want to go back to the original repo. I'd like to modify the maven artifact id for my clone so that it's not in the same namespace as the original, but obviously I don't want to push that change to the original.

What's the easiest way for me to set up a clone so that I can change the maven artifact ID and not have to worry about accidentally pushing that change to the original when I push my other changes?

emmby
  • 99,783
  • 65
  • 191
  • 249
  • 1
    I would temporarily add the specific project/pom.xml to `~/.gitignore_global`, however, this also ignore other changes in the pom.xml. Does this meet your requirements? – yorkw Oct 23 '12 at 21:47
  • that could work. not ideal, but might be good enough – emmby Oct 23 '12 at 21:52
  • 1
    If you do use git to ignore the pom.xml, change `.git/info/exclude` instead , which works like `.gitignore` but is repository-specific and also "[specific to one user's workflow](http://www.kernel.org/pub/software/scm/git/docs/gitignore.html)". – Jeff Bowman Oct 24 '12 at 04:56

2 Answers2

1

One way to automate that is to have a script:

  • modify that maven id for you on git checkout
  • restore the original id for you on git commit

Use for that a gitattribute filter driver (your script will have to recognize the content of the pom.xml to modify, since they won't have the name or path of the files they can change)

enter image description here

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

The solution I went with was to ignore the file(s) locally in my repo using .git/info/exclude as per the comments.

emmby
  • 99,783
  • 65
  • 191
  • 249