Push to remote
Push to remote repository
Now that we have a remote repository setup, let's see how we can push further modifications from local on to the origin.
Make a new commit
Let us make a small modification to the second file add it to the staging area and commit it to the local repo using the below command:
Check the status and log
We can see that we are one commit ahead of our origin since we have not yet pushed it!
Make another new commit
Let us make another new comment just to get to know the process better
Make a small modification to the same file and commit it using the below commands:
This time we see that our local repo is ahead of the origin by 2 commits!
Push the commits
Now that we have made commits and we are ready to push the code or contents on to the origin, let us issue the below shown command:
Our local repo and origin are in sync with each other now.
Notice that we used only git push
without mentioning anything else. This was possible because we had used the -u
and set the origin
as the default previously!
Last updated