amitshree
amitshree

Reputation: 2298

git push after deleting few files

I am a newbie to git hub. I have created a repo and pushed two files to it. By mistake a new file .README.md.swp is created inside my repo. Now I have deleted two files .README.md.swp and ramu.txt locally after that how can I update my repo on original Github site.

Upvotes: 4

Views: 5170

Answers (3)

chooban
chooban

Reputation: 9256

Instead of git add use git rm <filename> and then commit and push as usual.

You might also want to add *.swp to your .gitignore file.

Upvotes: 2

Srikanth Venugopalan
Srikanth Venugopalan

Reputation: 9049

Try these steps

git rm .README.md.swp
git rm ramu.txt
git commit -m "cleaning up blah blah"
git push origin master

Upvotes: 4

Kevin Bowersox
Kevin Bowersox

Reputation: 94429

After deleting the files run:

git add .
git commit -m "files delete"
git push origin master

Note that master should be the name of your branch, the default branch name is master

Upvotes: 3

Related Questions