jeudi 5 mars 2015

Is it possible to ignore a file once it is already tracked in Git?



Is it possible to add a dummy configuration file once (so that other developers can see how the configuration file should look) and then ignore it using the .gitignore file. Then replace the dummy config details with working ones so I can continue to develop the project and keep committing changes? But the original dummy config file will remain intact on Github?


This is the approach I attempted:



  • create repository on Github

  • intitialise local repo

  • pull remote repo

  • push local repo to github with Configuration.java (containing dummy details)

  • add Configuration.java to the .gitignore file

  • push local repo to github

  • add correct details to Configuration.java

  • push local repo to github


But the change to configuration.java is tracked, so this doesn't work.




Aucun commentaire:

Enregistrer un commentaire