bevacqua
bevacqua

Reputation: 48566

Git remove files on server not present on local

Often I would move files locally say from one folder to another. When committing to Git, I have to manually remove the files on the server that do not match a file path existing on my local repository.

How could I make this a less painful task?

Upvotes: 3

Views: 2558

Answers (1)

Daniel Pittman
Daniel Pittman

Reputation: 17232

git commit -a will automatically stage all modified and deleted files, so that your commit will reflect those changes. It doesn't automatically add new files, though, which you will still need to do by hand.

You can also look at git mv and git rm to do things a little more smoothly - in the sense that they will act on the checkout and stage the results, so you only have one command to issue.

Upvotes: 4

Related Questions