The git push
command is used to upload local repository content to a remote repository. It is most commonly used to publish and upload local changes to a central repository. After a local repository has been modified, a push is executed to share the modifications with remote team members.
This command’s syntax is as follows:
git push <repo name> <branch name>
If you want to push all your changes (in all the branches) to a remote repository, you can use:
git push --all <REMOTE-NAME>
The --all
flag tells the system that all branches need to be pushed to the remote repository. You will want to push the branches to the <REMOTE-NAME>
.
--force
flagThe --force
flag tells Git to ignore the local changes made to the Git repository at Github.
git push <remote> --force