1

I've done some commits to my repository, but now I've deleted some files that I didn't need, but after other commits, they haven't been deleted in the repo.

For example:

In my initial commit I inserted files main.py, class1.py and class2.py

In my second commit I added the file class3.py and deleted class1.py, but that file is still in the repo.

Is there any way to just synchronize the entire repo with a command or something without having to delete files manually?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250

1 Answers1

0

You would need git add -A . or at least git add -u ., to record addition and deletion.

See "How do I commit all deleted files in Git?".

With Git 2.0, you can type anywhere your repo:

git add -u :/

That would record all deletion from the top of the repo.

See also "Difference between “git add -A” and “git add ." for the importance of the '.'.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250