Synchronizing Changes Back to GitHub

Synchronizing the local branch with the remote repository to get the additional commits that have been added to the upstream branch.

Through this process, we can push our commits to the project which is present in GitHub.

Now let's move on to the GitHub Account, In that select your personal repository Starter-web-1 which is personally forked off of the scm_ninja version of this repository. As you can see, this repository is in the state, that was left off.

You can go to commits part, you can see your last commits number, in my case, I can see 5 commits and click on that you will see the details of those 5 commits, now back to your repository page and start synchronization with a local branch.

Let's open your git bash terminal and go to your project folder and then cd into the starter-web-1 folder, If you do an ls, you can see the files in your project folder and also check git status which tells us that we are on a clean working directory.

Here git status, pointing out that our master branch is ahead of origin/master by 13 commits. So this is what we have done as a part of this project section.

Let's synchronize this before continuing on this project, it is best practice to pull changes before doing any pushes and hence git pull origin master returns with the message as we are already up-to-date because we have not done any changes yet.

Now let's push our changes back to GitHub by using git push origin master, where origin refers to the name of the remote repository as we have given in this repository and master is a default branch we have in this Git repository and press enter.

So we have successfully pushed all the changes back to Github and go to your browser verify by refreshing the page and go to commits part, now you can see that there are 18 commits that are part of the git repository.

  • So if you click on 18 commits, you can see the entire history as well.

Configure Github Account

0 results
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions