Tag: gitignore

How to get git to ignore directory on my server?

Let’s say my repo looks like this: myApp public index.html … tests foo.js … I want the tests folder to get pushed to GitHub but NOT to my server. How do I accomplish this? Since I want tests/ to get pushed to GitHub I cannot simply add /tests/* to my .gitignore file. I’ve tried adding […]

Git ignore not ignoring one file, but all files

Here is the content of my .gitignore file # Compiled source # ################### *.com *.class *.dll *.exe *.o *.so # OS generated files # ###################### .DS_Store .DS_Store? ._* .Spotlight-V100 .Trashes ehthumbs.db Thumbs.db #Eclipse/Intellij .classpath .project .settings/ target/ *.iml .idea/ Basically all I want is to ignore the directory .idea and all the content in it. […]

How to get git to stop ignoring one folder

I have a programming project in Visual Studio and i use the Git with it. The Visual Studio automatically generated a .gitignore file in my project’s main folder. This is the part that ignores the bin folder, which contains my compiled project in debug and release folders: # Build results [Dd]ebug/ x64/ build/ [Bb]in/ [Rr]elease/ […]

Example of gitignore file for java

Can you show me example of .gitignore file for java, that consider a lot of different files that are not included(jar, war, classpath, files that IDEA and other IDE generates and so on and on). I mean really big .gitignore. What I currently have is **/target/ /target/ */target/* .classpath .project .settings # Package Files # […]

Git (SourceTree): gitignore already tracked files without deleting from online repository

There are numerous questions about this argument BUT none of them was useful in my case. I’ve pushed my local project to a bitbucket repository, including a config.php file. Now I’ve changed my local copy of the config.php file and I need to keep it different from the bitbucket copy. I updated my gitignore file […]

Git ignore files with particular extension in a particular folder name

I am using git 1.9.5 (Windows 7) and want to ignore some files with particular extension in a particular folder name. for example: A\Reports\fileA.docx A\Reports\fileA.pdf B\Reports\fileB.docx B\Reports\fileB.pdf C\Reports\fileC.docx C\Reports\fileC.pdf I have tried Reports\*.docx and Reports\*.pdf, didn’t work. I understand the .gitignore could be put in each folder (e.g. A, B, C). However, I have many […]

Ignore all files except in subfolder

I have a git repo with many files and folder but I want to ignore everything except files and folders in a src folder. This is my .gitignore: /* !**/src/ !.gitignore !README.md But this is what git status returns: $ git status On branch master Initial commit Untracked files: (use “git add <file>…” to include […]

How to ignore obj folder using Git under MS Windows

I have got following path that I need to exlcude to commit with Git C:\Projects\GitHub\MyProjects\TED\SourceCode\Presentation\REXI.Web\obj Everything is under C:\Projects\GitHub\ is cloned Git repository. And at the same folder I have got .gitignore C:\Projects\GitHub\.gitignore So which pattern I have to use to exclude obj folder? Thank you!

Git ignore file, without deleting it

I have a website under version control using GIT. I have a system set up that essentially, automatically deploys changes in my master branch to my production server. Namely, I have a web-hook in my repository that triggers a PHP script that essentially initiates a git pull on the server in order to pull down […]

Avoid pulling files which are in .gitignore

I have git repository and I am collaborating with other developers. I have written added folders in my .gitignore file to ignore them. However whenever I do git add . , it adds the files from these folders. Also when I pull the latest code from, using git pull it fetches the files from the […]

Git Baby is a git and github fan, let's start git clone.