Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Making Local and Remote Changes | More Advanced Workflows
GitHub Fundamentals
course content

Course Content

GitHub Fundamentals

GitHub Fundamentals

1. Introduction to GitHub
2. Basic Interaction with Remotes
3. More Advanced Workflows

bookMaking Local and Remote Changes

Congratulations on completing the previous sections! Now, it's time to explore more complex scenarios and learn how to deal with merge conflicts.

First, let's make a commit directly to our remote repository to simulate collaboration.

We added the following line to the README file using the GitHub interface:

Let's now add a new line to the README file locally. However, this line will be a bit different since we'll specify (local) to identify that these changes were made locally. Before appending a new line and directly committing this change, make sure to switch to the main branch:

Once on the main branch, we can append a new line to the file using the echo command with the >> operator and make a direct commit without explicitly staging the changes:

Push Attempt

Since the changes are committed locally, it seems all we have to do is run the git push command to push the changes to the remote repository:

Oops, it seems pushing changes failed. What happened is that when we tried to push, Git rejected our changes because the remote repository has updates that our local branch does not. This indicates that we need to sync our local branch with the remote repository before we can push our changes.

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 1
We're sorry to hear that something went wrong. What happened?
some-alt