threads / discuss / 16325

getting started with git

Subject: getting started with git

## tl;dr

3 messages between Nov 14, 2008 and Nov 14, 2008.

replies: 2people: 3as markdown or json

Ivan Senji· Nov 14, 2008, 10:16 UTC · lore
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!
-- 
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.
Tor Arvid Lund· Nov 14, 2008, 12:56 UTC · re: Ivan Senji · lore

Re: getting started with git

On Fri, Nov 14, 2008 at 11:16 AM, Ivan Senji <ivan.senji@gmail.com> wrote:
Show 9 quoted lines
> 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-
Lars Hoss· Nov 14, 2008, 14:29 UTC · re: Tor Arvid Lund · lore

Re: getting started with git

Show 7 quoted 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

← back to recent threads