Conteúdo do Curso
GitHub Fundamentals
GitHub Fundamentals
Remote Branches
As you have just seen, when working with remotes, there are two types of branches: local and remote.
Let's take a look at the remote branches (-r
stands for remote) that our Git repo is currently tracking by running the following command:
HEAD
is a reference to the current commit in your working directory. It points to the latest commit on the current branch you are working on. origin/HEAD
is a symbolic reference that points to the default branch of the remote repository. Typically, this is the main
branch that the repository considers the primary branch for development.
Since these branches are read-only, you must fetch the changes to your local machine, merge them with your local changes, and then push them back to the remote repository to make changes.
That's all good, but how can we find out whether our current branch is up to date with its remote counterpart? The familiar git status
command can help with this; it not only shows the status of your local working directory but also indicates if your branch is ahead, behind, or in sync with the remote branch it tracks.
Let's now run it:
In our case, git status
tells us that our local main
branch is up to date with origin/main
, meaning there are no new changes on the remote main
branch that you haven't already included in your local version.
Tudo estava claro?
Conteúdo do Curso
GitHub Fundamentals
GitHub Fundamentals
Remote Branches
As you have just seen, when working with remotes, there are two types of branches: local and remote.
Let's take a look at the remote branches (-r
stands for remote) that our Git repo is currently tracking by running the following command:
HEAD
is a reference to the current commit in your working directory. It points to the latest commit on the current branch you are working on. origin/HEAD
is a symbolic reference that points to the default branch of the remote repository. Typically, this is the main
branch that the repository considers the primary branch for development.
Since these branches are read-only, you must fetch the changes to your local machine, merge them with your local changes, and then push them back to the remote repository to make changes.
That's all good, but how can we find out whether our current branch is up to date with its remote counterpart? The familiar git status
command can help with this; it not only shows the status of your local working directory but also indicates if your branch is ahead, behind, or in sync with the remote branch it tracks.
Let's now run it:
In our case, git status
tells us that our local main
branch is up to date with origin/main
, meaning there are no new changes on the remote main
branch that you haven't already included in your local version.
Tudo estava claro?