![]() To summarize, with the 5 commands below you can sync your forked repository with the original repository and push the changes to your Github repository. ![]() If you want to update the Github repository, you need to push your changes. $ git merge upstream/masterĪt this point your local branch is synced to the original repositories master branch. If you have made any changes that create a conflict, you will obviously have to resolve those before you can complete the merge. This will bring your fork’s master branch into sync with the upstream repository without losing your local changes. Merge the changes from the upstream/master into your local master branch. Make sure that you are on your fork’s master branch $ git checkout master Remote: Total 62 (delta 27), reused 44 (delta 9) Remote: Compressing objects: 100% (53/53), done. ![]() Note that commits to the original repository will be stored in a local branch called, upstream/master $ git fetch upstream The easiest way to set the upstream branch is to use the git push command with the -u option for upstream branch. The first thing is to fetch all of the changes from the original repository. Navigate to the directory that contains your forked repository that you configured with the upstream repository You are now ready to pull the changes from the original repository to the your forked repository. Run the following command to list the currently configured remote repositories Navigate to the directory that contains your forked repository Open a Command Prompt (Windows) or Terminal (Mac or Linux) In order to pull the changes from the original repository into your forked version, you need to add the original git repo as an upstream repository. In order to sync the forked repository without adding any additional commits as part of the process you need to configure the original repository as an upstream remote, merge in the changes from the original repository and then push the merged version back to Github. You could do a pull request but this adds an additional commit into your forked repository instead of making your forked repository match the original repository. Even if you are not going to submit a pull request to the original repository, there are times that you want the additional features and/or bug fixes that have been done since you forked the original repository. Within each of these approaches, we will. Esta acción la llevas a cabo cuando quieres ver en qué han estado trabajando los demás. They are : Working with upstream and origin Working with branches. El comando git fetch descarga commits, archivos y referencias de un repositorio remoto a tu repositorio local. Syncing your forked repository to the original repository is an important step before submitting any pull request to the original repository for the changes in your forked repository. In this article, we will look at 3 different ways to work with git. (upstream) clone git clone :user/upstream-project.git git remote set-url origin :user/local-project.git git remote add upstream :user/upstream-project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |