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.

2
  • Have you pushed the changes to the remote repo? Commented Oct 3, 2013 at 19:36
  • No I haven't push to remote. Commented Oct 3, 2013 at 19:37

3 Answers 3

2

git rm [insert_filename_here]

Followed by

git commit -am "deleted blah blah"

git push

Sign up to request clarification or add additional context in comments.

Comments

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!

1 Comment

You don't need to add files that are already in the git system and simply changed - status M.
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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.