Skip to main content

GitKit (VSCode Edition): Learn git and GitHub in Context

Section 4.5 Pushing main to Your Origin

Exercises

1.

Your local main branch is now in synch with the upstream main branch. What’s left is to also synch the main branch in your origin repo.
(a)
Recall that you previously used the
git push <remote repo name> <branch>
command to push your feature branch from your local repo to your origin repo. Use the git push command to push the main branch of your local repo to your remote origin repo.
(b)
    Examine the output from Task 4.5.1.a. You should see a lot of information about deltas and objects. Those are terms related to the inner workings of git that we will not worry about. If you don’t see this information about deltas and objects but see an error message instead, revisit Task 4.5.1.a and try again.
    The last two lines of the output in part a should contain some recognizable information. What do you think that these lines are telling you?
  • The URL of your origin on GitHub.
  • The name of the branch pushed to GitHub.
  • The URL of the upstream repository on GitHub.
  • A list of all the files changed in the local repository.
  • A list of all the branches in the local repository.
Hint.
Only look at the last two lines, the one that starts with "To" and the one that starts with a SHA code.
As with most things related to Git and GitHub, there are a number of different ways to synchronize. For example, you can also fetch the changes from the upstream main to your origin and then pull them from there to your local repository. If you are curious, you can check out this GitHub link: Syncing a fork
 1 
https://docs.github.com/en/github/collaborating-with-pull-requests/working-with-forks/syncing-a-fork
You have attempted of activities on this page.