Home Ask Login Register

Developers Planet

Your answer is one click away!

Zoltán Schmidt February 2016

Download new Git branches to local Git repository

I set up a local Git repository that then I uploaded to GitHub.com as a repo to my account. If someone commits to it via the online interface (because it can't be done otherwise if my Git repo is local, on my PC - at least as far as I know), then how can I add the commits and branches of the given person to the local Git repo?

Maybe is there a command in Git Bash to add that info to the local repo?


Jonathan.Brink February 2016

First, no one will be able to commit to your GitHub repository unless they have your credentials.

If they do have your credentials and make a commit you can download that commit to your local copy of the repository with:

git pull

Marcus Müller February 2016

You misunderstand github. No one but you can push changes to your repository on your account. What happens when someone else changes something on the website is that they automatically create a fork, and a pull request, which is up to you to accept or don't.

The rest is normal git usage: to get changes done from a remote repository, do git push or git fetch, depending on whether you want to merge or not.

Really, I can't give you a full introduction to git here; read a git tutorial or do the github tutorials!

Post Status

Asked in February 2016
Viewed 1,851 times
Voted 6
Answered 2 times


Leave an answer

Quote of the day: live life