-1

Hi I am using git version 2.1.0 in my rails application . I want to ignore shell script from a folder called services

/services/*.sh

I have used this code in .gitignore , but it doesn’t works.I have called a single file directly too like

/services/setup_env_local.sh

its also not works .But other extensions like .log , .rb are ignoring with the same code

/services/*.log

what is the mistake I have done?...

Navin
  • 636
  • 8
  • 19

1 Answers1

1

Create a file in the root of the git directory called .gitignore and add the line /services/*.sh to it. This should work.

CorbinMc
  • 588
  • 2
  • 8
  • I already have a gitignore file, my question is only the shell scripts are not ignored why.. – Navin Dec 25 '14 at 05:41
  • 1
    maybe this is your issues http://stackoverflow.com/questions/7075923/resync-git-repo-with-new-gitignore-file – Aameer Dec 25 '14 at 05:42
  • 1
    @Navin I tested this locally on my machine and *.sh files are ignored the same as all other file types. – CorbinMc Dec 25 '14 at 05:44
  • @Navin gitignore will only ignore if the files are untracked if your file is already tracked by git then gitignore will not have any effect on it. – user85 Aug 28 '20 at 05:54