Tag: gitignore

git ignore everything except nested folder

I have a large code base (say, a wordpress installation) and want to ignore everything except the few files I myself changed (say, a theme). I know I can ignore files except some single files with /foo/* !/foo/bar But if the directory I want to keep is deeply nested, this does not work. I tried: […]

Stop git from re-deleting an ignored file that used to be tracked?

A previous poster wanted to track a file in one branch and not in another; I just want to not track it at all. I used to have “.p4client” tracked in git, which turned out to be a mistake. So I deleted it from the repository, added the name to .gitignore, and recreated the file. […]

Unwatch all files that start with certain text in file name/title

I’m trying to unwatch all files in my Git repository whose file names start with ‘form.’ For example: ‘form1.cfm, form2.cfm, form3.cfm,’ which are all throughout my repository in several different levels of directories. This following command has worked for unwatching entire directories, but it’s not working in what I’m doing now. git rm –cached -r […]

.gitignore in xcode not taking effect

My GitHub project has this structure: folderA: unrelated stuff folderB -> MyProject -> all Xcode related files including the .xcodeproj In MyProject I’ve downloaded this .gitignore: https://github.com/github/gitignore/blob/master/Swift.gitignore This .gitgnore has a line that says xcuserdata. However when seeing the pending changes in git, I clearly still see files inside MyProject.xcodeproj/project.xcworkspace/xcuserdata/. My GitHub repository was empty, […]

How to prevent `git checkout` from checking out specific file types?

We are creating a system in which users will be able to push arbitrary content to a shared Git repository. Our server will then checkout the repository and use the files. To reduce risks, I’d like the git checkout command not to write any .exe, .cmd, .bat etc. on disk, and control which file types […]

Keep ignored files when switching branches in git

Eclipse has it’s own files .project, .classpath and .settings folder. In git, I have them in the .gitignore file, because I don’t want them to be tracked in the remote repository. My problem is that when I switch branch, and then switch back, those files have been removed, so eclipse doesn’t recognize the project and […]

How to make Git “forget” about a file that was tracked but is now in .gitignore?

There is a file that was being tracked at one time by git, but now the file is on the .gitignore list. However, that file keeps showing up in git status after it’s edited. How do you force git to completely forget about it?

Add previously ignored git files. git add -f not working

I used git status –ignored To check which files were ignored as follows : git status –ignored # On branch SIT # Ignored files: # (use “git add -f <file>…” to include in what will be committed) # # web/sites/default/files/ So, that’s fine. But when I use : git add -f web/sites/default/files/ And then use […]

First push of Android Studio in Git

Question partially related with gitignore file. Now when you create an Android project, Android Studio creates .gitignore with your project. BUT it does not help, these files would be ignored if your code is already in git repository and ignored files ARE NOT already pushed. .gradle /local.properties /.idea/workspace.xml /.idea/libraries .DS_Store /build Now i create a […]

.gitignore whitelisting vim folder

I am tracking and versioning my dotfiles with the help of vcsh and mr. As suggested, i let vcsh create a predefined .gitignore-file to ignore unneeded files outside of my .vim-directory. However, now i want to modify it so it would not ignore my .vimrc nor my ~/.vim-folder with all its subdirectories. Currently, this is […]

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