I recently created a git repository on my server. Unfortunately during my last commit and push I had accidentally added all of my object files and some other junk files by mistake. Now when I do a git pull on my server side project I get abort warnings about overwriting my object files etc and I have to go and delete all of the problem files. I want to delete all of these files from the respository using the git add -A .
options once there are deleted and then committing (I think this is the right way to go). So basically to ensure I get rid of everything, I would like a way to get a list of the files that will be pulled from the repository - is there a command that does this??
Asked
Active
Viewed 191 times
1

bazz
- 276
- 1
- 3
- 10
-
you should check http://stackoverflow.com/a/1178586/1373571 the command you want is git-is-remote – Santiago Elvira Ramirez Sep 18 '12 at 18:13
2 Answers
0
You could reset HEAD to the commit before the commit that added everything and then do: git clean -xdf
to discard everything from the working directory. Warning: this will blow away all uncommitted files. If that's not what you want, do not use git clean

William Pursell
- 204,365
- 48
- 270
- 300
0
It doesn't make a sense. You should not care what was pulled. Git operates with a snapshots of the whole file tree. If you have committed files, the commit id is a1b2c3, and if any other working copy in any repo which has the commit a1b2c3 has exactly the same set of files. (I assume you have clean working copy).
So, you should change (remove) your files locally, commit and push your changes and checkout it on the server.

kan
- 28,279
- 7
- 71
- 101