Question

I'm trying to learn Git. I got a problem like this... I created a repository 'resorceplan' in GitHub. My colleague forked it and added new features to it. Now, he is not available in to push those changes to original repository 'resourceplan'. Is there any way that I can pull those new features into original repository ?

Any help will be appreciated !

Thanks.

Was it helpful?

Solution

Assuming you can read/access the other person's repository - yes, you can. There are several ways to do so, for example:

Add a remote, and pull/fetch from it

Add a remote for the other user, merge in the changes and then push to your own repository:

cd /my/repo
git checkout master
git remote add otheruser https://github.com/otheruser/repo.git
git fetch otheruser
git merge otheruser/branch

Treat as a "manual" pull request

Github has a help page demonstrating how to do this:

cd /my/repo
git checkout master
git pull https://github.com/otheruser/repo.git branchname
git push origin master

Both of the above do the same thing - retrieve the branch history from a different repository and add the new commits to your own local repository (from there - just git push to update your own remote repository).

OTHER TIPS

You should add your colleague as a collaborator, with the proper rights for pushing to your repo.

enter image description here

You can find documentation about it here: https://help.github.com/articles/what-are-the-different-access-permissions

Unless your colleague has admin privileges to your git repository, they will not be able to push directly to it.

The typical github contribution cycle is to fork the repository, create a branch for your change, commit the change to the forked repository and then to create a pull request to have the changes accepted upstream.

If you add your colleague as an administrator to the repository, forking it is unnecessary since they can create their own branch and work off of it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top