You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hasnat Anjum Haz edited this page Jun 29, 2021
·
6 revisions
For first time
Copy the HTTPS/SSH link from the remote repository you want to fetch. At your local, write the following command-
gitremoteadd<remote_name><HTTPS/SSHlink>
This adds the remote repository in the local branch you are in. Now fetch the code from the remote-
gitfetch<remote_name>
Remember, you don't want to merge the code of the PR with your local branch. git fetch brings the code to you but don't merges with you. So, don't do "git pull <remote_name> <branch_name>". Now to run the code and work with it locally, do
gitcheckout-t<remote_name>/<branch_name>
This will create a branch at your local with the same name as the name of the remote's branch.