When you have worked on your changes and want to push them to a remote repository, do the following in the local branch:
To rename or move files, run git mv OLD NEW
. This helps to keep the resulting diff meaningful, while Git should figure this out automatically.
To remove files, run git rm FILE
. This also stops tracking the specified files, while it's redundant if all changes are staged later anyway.
If you have added files, run git add .
in the branch root. This starts tracking any files in the branch that aren't currently, and also stages any changes.
To check the status of the branch, run git status
.
Commit your changes by running git commit -a
. This stages any changes, and will open a text editor to enter the commit message.
After you have done one or more commits, run git push LOCATION BRANCH
to push your changes to a remote repository.
The commit message should summarize all the changes you have done after the last commit, you can specify it directly by using -m MESSAGE
.