Reputation: 2727
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.
Upvotes: 1
Views: 1324
Reputation: 66208
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 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
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).
Upvotes: 6
Reputation: 3029
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.
Upvotes: 0
Reputation: 10867
You should add your colleague as a collaborator, with the proper rights for pushing to your repo.
You can find documentation about it here: https://help.github.com/articles/what-are-the-different-access-permissions
Upvotes: 0