Push from a cloned repository
Next, we can now push from the cloned repository we just created.
First, add the bold text below to the sample.txt
file in the newly cloned directory and commit the change.
Anyone can learn Git with this tutorial and Backlog
add: Register a change in an index
When the history log of your local repository branch updates, it will be ahead of the remote repository branch.
Now push the new commit to the remote repository.
Right-click on the directory “tutorial2″ and click “Push.”
Click “OK” to proceed to the next screen.
Click “OK” again.
The following screen shows the push in progress. Once it is complete, click “Close” to finish.
Select “TortoiseGit” > “Show log” from the right-click menu. Now main
and origin/main
are on the same level. That means the remote repository is now updated with the latest change and in sync with the local repository.
You will now find the newly pushed commit listed under “Recent Updates” on Backlog’s Git page.
In the next section, we will cover branches in greater detail, but this is now the location that each of the following references points to:
- origin/main: Points to the main branch of
origin
, which is typically the remote repository. - origin/HEAD: Refers to the current commit of
origin
, i.e., the remote repository. In most cases, the local repository will point to the same location asorigin/HEAD
when performing a clone (the equivalent oforigin/main
). However, this won’t be the case if you check out to a different remote branch. - main: Points to the main branch of the local repository.