Categories

Category cover

Automation
155 posts

Category cover

Learning paths
119 posts

Category cover

CISO
22 posts

Category cover

Security
20 posts

Category cover

Notes
19 posts

Category cover

Personal Security
18 posts

Category cover

Infrastructure
12 posts

Category cover

OT/ICS
5 posts

Category cover

Books
3 posts

Category cover

UNetLab
3 posts

Category cover

Write-up
3 posts

Category cover

OSInt
2 posts

Category cover

My life
1 posts

Collaborating with Git by working with remote repositories and forks

Andrea Dainese
September 10, 2024
Post cover

In the previous post, we covered the basics of using Git locally. Now, let’s dive into real-world scenarios and learn how to collaborate using Git with remote repositories.

When working with remote repositories, we gain access to some new functionalities:

  • clone: allows us to create a local copy of a remote repository.
  • pull: lets us update our local branch with changes from the remote.
  • push: enables us to update the remote branch with our local changes.

Typically, pull and push actions are not allowed directly on the main branch. This forces us to always create a new branch for our changes, which we’ll then merge into the main branch.

Moreover, we often don’t have permission to create branches on repositories we don’t own. This requires us to create a fork, which is a copy of the entire repository we want to work on. We can then create a branch on this new repository, make our changes, and request (via a Pull Request or PR) that the original repository merges our changes.

But let’s take it step by step.

Origin

First, let’s clone a repository of our choice:

Continue reading the post on Patreon .