2

I have deleted several unnecessary files in my local and also changed the location of some files. I want my github repository to match what I have locally.

I have previously use command:

git rm

To remove specific files, but I wonder if there is a more efficient way to do it.

irm
  • 4,073
  • 6
  • 28
  • 32

3 Answers3

2

git rm [insert_filename_here]

Followed by

git commit -am "deleted blah blah"

git push

tom
  • 2,335
  • 1
  • 16
  • 30
2

To ensure that your local repo. matches the github repo. just run git status, check and see if an y files have been modified, deleted, or added. If so, then you can stage those files to be commited.

To stage a file(s) to be commited, I typically use

git add <rel_path_to_file> (for each file that is to be changed or added) followed by a

git commit -m 'your commit message'

then when you're through staging the files that you'd like to commit, or telling git what you want to change in the github repo and what note to leave when you change it, just run git push

Hope that helps!

Drew
  • 2,583
  • 5
  • 36
  • 54
0

after

git rm

you should do

git status

to see you changes to avoid some unexpected changes. Then do,

git commiy -a -m "delete XXXX"

and then do,

git pull origin.

Last,

git push

Cobain
  • 186
  • 1
  • 8