![]() You can also delete the branch as this is no longer required. You do this by fetching the upstream files to local and merging them in with the files there (it’s a good idea to do this regularly, to keep up with all the changes). You now need to update the files in your local computer to reflect the new “official” repo files. Step 8 – Fetch the new upstream files and merge into local ![]() Other people may have been making changes to the upstream files as well. This is because your edited files still live in branches and your main (default) branch is now out of date. Note that in the diagram below, you are still not in sync with the “official” repo. If all goes well, you will get a message to say that your edits have been approved and merged into the main project. It’s recommended NOT to open a new PR for this – just do another commit to your file(s) in local, push to origin, and your latest changes will automatically flow through to the existing PR on upstream. Sometimes you might find the need to make some extra changes to your initial pull request, or perhaps the maintainers of the “official” repo have suggested you make some revisions. This process may take take a while because people are busy, but it’s acceptable to ping someone on your PR and ask them to take a look. Maintainers may ask questions to clarify the changes, how they have been tested, or they may ask for some revisions. There is probably a form template that you will need to use, to show you’ve followed the correct coding standards and done all the necessary tests. Now both local and origin will be different to upstream.Ī pull request (PR) sends a message to the people who maintain the “official” repo, asking them to consider adding in your edits. When you are happy with the changes you’ve made, you can publish (push) them to your GitHub account. Step 4 – Publish your changes to origin when you are done Your local files will now be out of sync with origin and upstream. GitHub will keep track of everything and it’s easy to roll back to a previous commit. You can commit these as you go at any time. Once you have created a branch, make quite sure GitHub Desktop is showing it as your current active branch, then go in and start work. You should do this in a branch this keeps your workspaces separate and manageable. Now, it’s time to get to work and start making your changes to the file(s). ![]() Step 3 – Create a branch, work on some files and commit the changes You can do this through GitHub Desktop by cloning the files from origin. In order to work on the files easily, you will need to make another copy on your local machine. Step 2 – Clone the fork to your local computer with GitHub Desktop This is called a fork and it involves copying the files from the “official” repo (upstream) to your own account (origin). You obviously can’t work directly on the main project files, so you first need to take a copy of them to your own GitHub account. Note that each of the steps will get their own articles in the future as parts of this series. Boxes are shown in blue when they are synchronised with the current official repo red means they have got out of sync green is used when the upstream repo has been changed. The diagram above will be used throughout this tutorial to illustrate the various exchanges. It is important to understand the interaction between the three players at all stages in this process. The objective of this tutorial is to show you how, using the GitHub Desktop, to contribute to an open source project by working on files from some remote repository and then submit them (make a pull request) so they can be merged into the “official” project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |