Syncing to the remote

This section will guide you through syncing your local repo to the remote one.

Any change made so far is only being applied to the local copy of the repository (i.e. the copy on your laptop). To apply your changes to the remote repository (i.e. on GitHub or Azure DevOps), you need to “push” the changes.

Having recorded your changes, follow the instructions below to sync to the remote.

The first time you update your remote repo with the changes you committed to your local one (aka push the changes), use the command below:

git push --set-upstream origin <github_username>/main

After that, if you want to push changes you committed in the same branch use the following command:

git push

Click the green upwards arrow to push your changes to the remote repo. You can do this from the commit window as shown in the image below.

Highlighting the upwards arrow for pushing changes to remote repos in the RStudio's Review Changes window.

Alternative method

You can also do this from the side panel after closing the commit window as shown in the image below.

Highlighting the upwards arrow for pushing changes to remote repos in RStudio's Git window. It is there to show an alternative way of pushing changes to remote repos.

  • Click on the branches drop down menu at the top of the screen and click “Push”.

  • A screen will pop up with your previous committed changes.

  • Click “Push”.

Highlighting the Push option in the branch drop down menu.

Highlighting the Push button in the Push Commits to git-academy-sandbox pop up window that appears after completeing the previous step.

Alternative method

Alternatively you can push and commit your changes at the same time from the commit window by clicking “Commit and Push” after you write your commit message.

Highlighting the Commit and Push button in the Commit pop up window that appears after following the steps in recoding changes part of this guide.

Back to top