Essentially, this just means that a copy of the official repo is created on his account, and that he takes full ownership of the copy. When a new developer wants to start contributing to the project he starts by "forking" the official repo to his GitHub account. Here is how these remote repositories were created: This time, each developer has his own remote repository on GitHub, to which he is free to push. In the next section, we will see how this security issue is avoided by using forks and pull requests. And with the right to push, any developer could wreak havoc into the repository, e.g. Indeed, it would require giving all developers the right to push into the official repository. Also, each of them is still in full control of his own local repository.īut this workflow should never be used, because it is not safe. With this simple workflow, Bjarne and Guido can exchange code and build their project together, without ever connecting to the other person's machine. push the new commits to the official repository.This is important, so that his version now contains the new code from Guido as well merge them into his code, which results into a new merge commit.fetch the new commits from Guido from the official repository, which appeared while Bjarne was developing."pushed" the new commits to the official repository.Īt the same time, Bjarne has implemented another new feature.committed the code to his local repository, maybe in several successive commits.implemented the feature on his local machine.Guidelines for a successful pull request.Pushing your modifications to your remote.Forking and cloning a GitHub repository.If you haven't read the first part, Git : Overcome your Fears, please take a look now to make sure you understand the basic concepts of Git.įor this tutorial, I have chosen GitHub as a remote git platform because it is accessible to everybody, and because most open-source projects are on GitHub.īut if you're using a different platform such as GitLab, don't worry, all platforms are very similar. This article is the second part of my series about Git. You need to know them.Īfter reading this guide, you will get a better picture of all this, and you will be able to collaborate smoothly with fellow developers on great projects ! Software collaboration is governed by a few basic rules, which unfortunately often remain unspoken.It's easy to mess up your local version of the code when integrating the work of others, if you don't know what you're doing.It's already difficult to follow what's going on in a single repository, and it's even more difficult with three repositories, especially if you don't fully control them. To collaborate with others on a single project, you need to interact with several repositories, most often three: your local repository, your remote, and the official repository. Collaborating with git can be quite intimidating at first.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |