Git pull from someone else's fork Git pull from someone else's fork git git

Git pull from someone else's fork


Simply add a new remote (say, other) in your own repo. Then Pull other/<branch> changes into your local branch (say, add-other-changes). Push to your own forked repo (origin/add-other-changes). Now, when you done with add-other-changes branch, create a Pull request & merge with origin/master.

  • Pull other repo's changes into your own repo:

      # go into your own repo  $ git remote add other <other-student-repo-url>  # add a new remote with other's repo URL  $ git fetch other         # sync/update local with other's repo  $ git checkout -b add-other-changes       # create a new branch named 'add-other-changes'                      $ git pull other <specific-branch-name>   # pull other/<branch> changes             $ git push origin HEAD    # push changes to your own(origin) forked repo `add-other-changes` branch


If you both want to work on the same project, then you shouldn't have forked the the repository twice. You or you friend (not both) should fork the repository, then both of you should clone the forked one in local (permissions need to be granted by the one who forked repository).

Once this is done, when members of the project want to know if there are new changes on the remote, they can do git remote update or more commonly git fetch origin.

If you're working on the same branch and you want to update your local branch with the remote one git pull origin <branh_name>

If one have made changes that should get shared:

git add file_path_1 file_path_2 directory_path1 ...git commit -m "<your brief message>"git push origin <branch_name>


commit and push your working branch. Then do a merge from the main branch to your branch. Ensure all build and resolve any conflicts. commit and push your branch. Now merge your branch into the main branch and it should work.