

So we want to add another remote pointing to the original repository so that we can periodically git pull any changes that have occurred in that repository such that we are working on the must up-to-date version of the code. While we are making changes, others might also be making changes and the original repository might be getting updated during the time you are adding a feature. However, the goal here is to contribute to the original repository and we want to keep up to date with the original. This means that when you do git add/ git commit/ git push you can push your local changes to the forked repository. When you cloned the forked repository onto your local computer, git automatically added a remote repository named “origin” pointing to the forked repository on GitHub. Then, at the command line, clone the repository, for example: $ git clone Navigate to your forked repository on GitHub, click the “Clone or download” button and copy the url. This is as simple as using git clone on the forked repository. Clone the repository locallyīefore you can make changes to the repository you’ll first want to make a local copy on your computer. To fork a repository, find it on GitHub and then click the Fork button. A “fork” is just an independent copy of a repository that you can develop on without affecting the original. The first step is to fork the GitHub repository you want to work on. Delete your feature branch using the GitHub website or, delete the local branch: git branch -d new_feature, and delete the remote: git push origin -delete new_feature.

Change to master: git checkout master and pull: git pull upstream master. Once the pull request is accepted, you’ll want to pull those changes into your origin (forked repository).Open a pull request on GitHub merging your changes with the upstream (original) repository.Push changes to your remote repository: git push origin new_feature. Sync dev branch: git checkout new_feature, git merge master. Pull new changes from remote: git checkout master, git pull upstream master.Make desired changes to the local repository on this branch.

