Page MenuHomePhabricator

Synchronize .gitignore files
Closed, ResolvedPublic

Description

The AQS 2.0 .gitignore files differ between separate services.

Also, some files that should be ignored have snuck into the repositories.

Synchronize the .gitignores across the repo, and remove any files that have made it in but which should be ignored. Note that simply adding a file to .gitignore is insufficient to remove it from git. Once it's in, you have to explicitly tell git to stop tracking it.

The repos to synchronize are:

The contents of .gitignore in each of those repos should be:

<the binary name for that repo>
*~
.idea/
.vscode/
.DS_Store

To be clear, "<the binary name for that repo> means the name of the binary file generated when you run "make" on that repo. So for example, the .gitignore file for the "pageviews" repo should look like this:

pageviews
*~
.idea/
.vscode/
.DS_Store

Regarding removing files that should not be in the repos, the only repo containing files that should not be there is "pageviews". It contains a .DS_Store file and a .vscode directory. These should be removed from the repository. Because git is already tracking these, you can't just delete it locally then commit and push. You have to actually tell git to forget about them. Here's how to do it for a file (replace "</path/to-file>" with the name of what you want to remove, in this case .DS_Store)

git rm --cached </path/to/file>
git commit -am "Remove .gitignored file"
git push

And here's how to do it for a directory (replace "<dir_name>" with the name of what you want to remove, in this case .vscode):

git rm -r --cached <dir_name>
git commit -am "Remove .gitignored directory"
git push

By the way, the "--cached" parameter causes git to leave you local copy of the file alone, and just removes the file from git's index. In other words, it makes git forget about the file, but it leaves your copy. If you were to leave off the --cached parameter, git would still forget about your file, and it would also delete that file from your local filesystem.

If you want to know more about the "git rm" command, there's more info here. In fact, that site has tons of great information about git, if you want to know more about how it works.

Related Objects

Event Timeline