Problems with git synchronization

Asked

Viewed 40 times

0

My friend made a Fork in my code and to update the data both in his repository and in mine, we have to create two remote one for each repository and use push/pull in both. How to make it just a remote?

1 answer

1

It is not possible to have a single remote if there are two separate repositories. Each remote is the remote address of the repositories.

The Fork of a repository makes it possible to have control over it, make the necessary editing changes, or delete files. That’s because we don’t have access to the original repository. This is a very common strategy in Open Source projects, as it allows you to have access to take the original code, have a repository structure and keep a repository apart, without doing any harm to the original.

So if the two developers have access to the original repository this strategy does not need to be used!

In case they want to have this strategy, the second developer does not need to have access to the first repository. To return the code to this repository a Pull-request.

Pull-request

It is a strategy of returning code to an original repository, the origin of the Fork, without having write access to the original repository. Normally the flow would be as follows, assuming you are using Github as the Storage of the Git repositories:

  1. Fork from the repository in the second developer account
  2. Clone repository "forkado" to the developer’s machine
  3. Necessary changes to the code, commit, and push to the repository "forkado"
  4. Creation of a pull-request from the second repository for the origin of the changed code
  5. The original repository maintainer analyzes the sending code and accepts the pr, thus placing the code in the original repository.

Understand that the pull-request is a Feature of "storages" repositories, as it is a function that pulls to a repository of a code that is being sent. It was developed by Github, but is present in Azure Devops, and other systems.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.