Reputation: 559
I have created a repository using GitHub for Windows (GfW) and added 3 commits and synced using aforementioned. Commits were visible on GitHub webpage and in my app. Then my brother forked my project to start collaborating with me. He successfully cloned it using GfW.
Then I made changes on my machine and pushed using "sync" button. Changes appeared on webpage and in my history, but my brother can't see them in his GfW. Even after pressing "sync".
What mistake are we making? I have also added him to collaborators in my project's settings, though it did not change anything. I guess I have misunderstood some basic principles.
Upvotes: 9
Views: 4843
Reputation: 149
I've been working with GitHub for 3 months ago, and there's a whole world out there about GitHub and source control.
Maybe you actually knows this, but I want to share something that I learned in this page
GitHub is just a hosting to the repositories.
But, there's something else ... Git.
Git is and Interface that brings all that the user need to have control and management of the repositories. In other words:
Git is a source control, a tool management for the record of the source code. Git is the tool and GitHub the service to the projects.
Until now, you've been using GitHub, well, I recommended to you, to use as well Git. Even more in this issue that you have right now.
neither of you have made a mistake. Maybe there something that your brother are ignoring.
There're two command that are so common in Git.
> git fetch //Bring all the changes from the remote server
> git pull //Fetch down new data from remote server
And I believe that here are your brother's problem. You have your repo up to date, but for some reason your brother not. And this is because he had to bring the new changes (made it in your repo) in his repo in some specific time. And this achieve with those command (if you use Git command line. You can use other tools, like Visual Studio, Eclipse, TortoiseGit, Git Bash, Git Gui). I know that command line sometimes is complicated, but also, it can help you when no one others can.
That's my tip to you. Actually, back days, I saw here in Stackoverflow a question, where the solution was to make a "mirror repository", How it works? Well, Every time that the person make a commit in repo1 (local repository) automatically sent the changes to repo2 (mirror repository... and yeap, that you will place in your brother's computer. But, I can't find it. I promised that I will keep searching that question and as soon as possible I'll share with you.
Maybe this is not an exactly answer for your problem. Have a good day!
Upvotes: 1
Reputation: 141
I would suggest to use Sourcetree git windows client. It is very user friendly and importantly free!
Upvotes: 1
Reputation: 12416
There are ways of using two forked projects for this, but it's going to get messy very quickly. You're probably best using just one github project and both cloning that.
Your brother could simply clone your original project and make his changes on his machine.
Then, when you push to github, he'll can pull and because he's looking at same remote repository you pushed to he'll get the changes.
You will need to give your brother permission to push to the project to collaborate easily so that you can get the changes he's making too.
Upvotes: 3
Reputation: 919
Your brother will need to sync his fork of your repo.
Documentation on GitHub here on what needs to be done.
Upvotes: 1
Reputation: 1499740
Well, there are four repositories involved here:
I haven't used GfW myself for a little while, but I suspect that Sync is only synchronizing between the last two projects listed above. I don't know whether there's GUI support for it or not, but the documentation on syncing a fork may be useful to you.
I suspect there isn't support for syncing a fork with the original though, given this documentation:
GitHub for Windows does not support multiple Git remotes and it will only work with the origin remote. If you wish to push & pull to other remotes, we suggest you use the command line client that is included with the application.
Your brother will effectively have two remotes: his fork (typically named "origin") and your original project (typically named "upstream").
Upvotes: 20