A few days ago I create a repository with an android project that I have been working on. Since then I have deleted a number of files and have added a number of others. Now I want to push my new changes to github. How do I do that? What are the commands to issue? I know I have o commit and then push to master. But how do I tell git that I have added and deleted a number of files? Normally I just do git add .
since normally I am adding stuff. But this time I have x new files and y deleted files.
You can use git add --all .
to record all changes, including deletions. From the man page:
-A
--all
Like -u, but match against files in the working tree in addition to the index. That means that it will find new files as well as staging modified content and removing files that are no longer in the working tree.
If you want more granular control, use git rm <filespec>
to remove files from the index.
After that, commit
and push
as usual.