Question

I have created a repo on Github and added a contributor to work with me on the project. I'm a little confused as to how to instruct them to work on the project

Some docs are saying they should fork the project to their own account and then clone locally

Other are saying create branches of the master

Im new to git and he is.. but i have working knowledge of CVS and SVN im confused as to instruct him the best way to checkout my master and work on it

So should I tell him to fork and clone.. or If i tell him to branch.. does he need to do an initial checkout of the master first?

Just trying to clear this up..

Oh.. also question for my own sanity.. I should be working off a branch off my own master.. and how does that effect the local files when I switch through branches

Was it helpful?

Solution

Whether to fork your repo or just clone and branch depends on your workflow. If you want to manage your project like a centralized system, then simply have him clone your repo locally on his machine using:

git clone https://github.com/username/your-project.git

Then he can make a branch and request that you pull from his clone. If you want to try the distributed method of source control management, then have him fork your repo. Then he can clone, make changes, push to his fork, and then send you a pull request right on github. I recommend forking because pulling from another machine seems a little more complicated and because github has some very nice features for displaying the changes that have been made. No matter which way you do it, I would recommend branching, making your changes and then merging back to master (you can see the reasoning in the answer to this question).

Oh.. also question for my own sanity.. I should be working off a branch off my own master.. and how does that effect the local files when I switch through branches

When you switch branches, git removes all your previous branch's commits and changes from files and then adds all commits and changes to files from your new branch. Also I recommend checking out the git documentation. It should be able to answer basic questions about how git works and how you can get started using it.

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