1

I like the idea behind open-source projects (packages, libraries, cms, etc.) and I want to contribute on projects I find interesting (and can help on tasks, bugs, features).

I've been using git for quite some time but to track projects I work on my own. Never had the chance to join a team and develop something together. (I know it's a must to you use vcs).

Here's the scenario, followed by my actual question:

  1. Found a composer package which I need and like (a wrapper for some service's API written in PHP) and wanted to improve something (a new feature steam released).
  2. I downloaded the github client (which is pretty strightforward way to contribute to projects on GitHub). Cloned the repository.
  3. Then I opened my favorite IDE (which is PHPStorm as of date) and added the cloned repo as a project.
  4. Changed what I wanted and went to the github client again.
  5. The client showed me the changes and has added to the changelist the .idea files from my IDE.

So here's the question:

Do I have to add those file to the ignore list (1) or should I select the option to "discard those changes"(2)?

The problems I see:

In the first case I will update the .gitignore file which might be redundant if none of the collaborators use PHPStorm or any other IntelliJ IDE.

In the second case I will have to do those actions everytime I want to commit something.

Can you tell me how it's done in the more experienced world?

Ivanka Todorova
  • 9,964
  • 16
  • 66
  • 103
  • 1
    You have a local .gitignore you can use http://365git.tumblr.com/post/519016351/three-ways-of-excluding-files – user2266449 Aug 20 '15 at 11:44
  • 1
    See [this question](http://stackoverflow.com/questions/5724455/can-i-make-a-user-specific-gitignore-file) and [the .gitignore documentation](http://git-scm.com/docs/gitignore) for how to set up a custom gitignore file. – cmbuckley Aug 20 '15 at 11:45

1 Answers1

2

You can either add those IDE-files to the projects .gitignore file, or if you don't want to add your local ignorable files to the project you could keep your own global .gitignore file.

git config --global core.excludesfile ~/.gitignore

Create the ~/.gitignore file and add .idea/

crea1
  • 11,077
  • 3
  • 36
  • 46