GIT Demystifying part 18
Work Team - Fork
continuing from https://jalbertomr.blogspot.com/2020/12/git-demystifying-part-17-work-team.html
Fulano has cloned the forked repository into his local maquine in order to work, do the changes to it, and when finish, push his change to his github Repository, and do a pull request to main account in order to integrate the changes into the main repository.
In this particular case, the lab will be done in a same machine, so for the fulano account we work on a directory, and configure locally the name and email. so init the git and clone.
It is important to update the email and name, in order to have the respective tracking of the autor in the commits.
So in order to have tracking of the main repository, the one wish has been forked, we need to create a remote pointing to that repository. This is done with git remote add <nameremote> <routeremote>
To reflect the created remote, we need to fetch that remote. and see that they are syncrhoniced. But what happend if the owner of the main repository do any change. So, lets do a new commit on the owner´s local machine, then push to his repository (owner repository). Once done that, fulano has to do a fetch to check for changes.
see that it is desynchronized from his remote origin. so need to push it.
Now, fulano has to check for the remote originforked changes.
And now see the change and the desinchronized from originforked, the owner repository.
Now push to origin repository, BUT an Horrible Error Happen
So, we have to delete the github credential from control panel - windows credentials.
Type the login data of fulano
And pass the push to the origin fulano repository
Notice that all the pointer are alined.
Check on the fulano´s github account that the change made by jalbertomr, the forked repo has been integrated on the fulano´s repository. (file2 added)
On the next blog, we do a pull request to request that our modifications are accepted by the owner repository.
eot