Tag: gitignore

When changing .gitignore, do all developers need to run `git rm –cached <path>`?

If I add file that is already tracked by Git to my .gitignore, I can simply run git rm –cached <path> to apply the new rules. I push that to the server, and the server will no longer receive my changes. Will I have to tell everyone on my dev team that they need to […]

Gitiginore all files except those with .rst extensions?

The ** and * in gitignore are a bit confusing. Here is what I have in .gitignore: * !*.rst This works for all *.rst files in the root directory. What about .rst files in subdirectories? I tried * !*.rst !**/*.rst But this does not change anything.

Is the “assume-unchanged” information committed?

There is a certain file that I want to share in its current state, but I don’t want further changes to be committed. So I did “assume-unchanged” to that file. Now, git ignores changes to this file in my repository. But what about other users of the repository – will they have to do “assume-unchanged” […]

have a new .gitignore tell me if any file already matches tracked files

is there a way to parse a .gitignore and tell me if i already have some files that match the ignores so that i know to remove them or change my .gitignore? example is that i have git tracking my imgs directory, and i wish to ignore all of windows Thumbs.db, and also tell me […]

Ignore modifications after git add -f

I’ve just downloaded (not cloned!) CakePHP 2.2.4. The directory containains a .gitignore file: # only the relevant part here /app/Config /app/tmp Now I executed these command because the directories (and their initial contents) Config and tmp would otherwise never been committed: git add -f Config git add -f tmp I have no problems with the […]

Ignore a file in git but have it downloaded when the project is cloned

I have a file that suffers modification every time I run my project. Thus, I don’t want git to track it and so I add it to my .gitignore file. However, I do wish for the file to be pulled when cloning the project. How can I achieve this? Thank you in advance.

Remove tracked ignorned files from repo but not locally

I keep running into a scenario where someone on our team pushes an initial commit without first adding a .gitignore to their project. This results in a bunch of files ending up in the repo that we don’t want tracked. git ls-files -i –exclude-from=.gitignore gives me a list of files that are ignored by .gitignore […]

How can I version my .git/config file?

I have a .gitignore file like the following: .* !.gitignore And I would like to version my .git/config file such that when I do a git pull my .git/config file updates automatically. How can I do this? I tried something like: .* !.gitignore !.git/config But this didn’t work. I know if I create a link […]

ignore gitignore files in subdirectories

This is the content of my “root” .gitignore # exclude everything … * # …except !/.gitignore !*/ !/modules/wp-azth/** the problem is that, under modules folder, i’ve a lot of third-party modules with a .gitignore file inside. Using rules above, all third-party modules folders are ignored but their .gitignore files are not ( and i don’t […]

.git/info/exclude replacement for git submodule?

I’m having python script to download dependencies for my library (that is extracted as git repository) and it adds lines to .git/info/exclude for git repository. But when it’s extracted as submodule no .git/info/exclude file exists and i still need to exclude some paths without adding them to ‘.gitignore‘. Any change to do it? repo ├─.git […]

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