Skip to contentSkip to conversation

getting started with git

DISCUSSION Ivan Senji 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore

Ivan Senji

author
#0 lore raw

Hello everyone!

I started using git recently to manage my personal projects and I really like it. I develop on several different locations and have a little problem that i couldn't find a way to solve.

On each location that i develop some project and configuration files are different. But i would like them to be in the repository as a starting point when checking out a project (example: opening a project on a dfferent OS in eclipse... eclipse will find an error in the path to jdk and ask me to fix that error by selecting a different jdk).

How to achieve that these files are in the repository but that any further changes to them are not commited (or are commited localy but not pushed to a remote repository)?

Is that even possible?

Thanks!

Signature · 2 lines
View this message in context: http://www.nabble.com/getting-started-with-git-tp20497802p20497802.html
Sent from the git mailing list archive at Nabble.com.
#1 lore raw
Quoted 9 lines · Ivan Senji

On each location that i develop some project and configuration files are different. But i would like them to be in the repository as a starting point when checking out a project (example: opening a project on a dfferent OS in eclipse... eclipse will find an error in the path to jdk and ask me to fix that error by selecting a different jdk).

How to achieve that these files are in the repository but that any further changes to them are not commited (or are commited localy but not pushed to a remote repository)?

Hi,

Well, if it were me, I think I would commit that eclipse config file under a different name... Say, ".classpath.defaults" instead of ".classpath". Then your README file could tell your users to start by copying the .classpath.defaults to .classpath, and update its contents as necessary. Put .classpath in your .gitignore file, so it won't be committed to the repository.

-Tor Arvid-

#2 lore raw
Quoted 7 lines

Well, if it were me, I think I would commit that eclipse config file under a different name... Say, ".classpath.defaults" instead of ".classpath". Then your README file could tell your users to start by copying the .classpath.defaults to .classpath, and update its contents as necessary. Put .classpath in your .gitignore file, so it won't be committed to the repository.

Template files (x.default) is a good idea. But regarding your example with .classpath: it's safe to add it to git since it's developer independent and project oriented. Therefore it's useful for every developer in the project who uses eclipse :-)

Yours,
Lars