1)
The reason we need our own public repositories is to allow us to share our changes. You can not commit or push to my public repository, so you need a mechanism to get your stuff out there. In contrast to a typical SVN setup where everyone commits to a central repo, git moves the control to the person taking others changes in. You make your changes locally with no permissions etc required and then push them up for others to see and optionally ask the main person (aaron for tuner, me for firmware, seank for gcc, etc) to pull your changes down and merge them in. You've got more chance of them saying yes if your changes are clean, and just fast forward from the main persons latest public commit.
2)
In order to pull others stuff down to your local repo you need to add remotes for them. This is a configuration thing, see my config pasted below :
Code: Select all
# Potential FreeEMS Contributors:
#
# This is my .git/config file!
#
# It is included here for several reasons:
#
# 1) So that I can easily update it on different machines that I use.
# 2) So that you can learn from it and setup your remotes as required.
#
# Further help is available here: http://forum.diyefi.org/viewtopic.php?f=41&t=547
#
# Note: downstreams of this repo should add rebase = true to their master branch config
#
# More information is available here: http://forum.diyefi.org/viewtopic.php?f=41&t=1103
#
# Please talk to the lead developer of any repo which you plan to work on before doing so!
[core]
repositoryformatversion = 0
filemode = true
# My redundant remotes
[remote "origin"]
url = git@github.com:fredcooke/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/origin/*
push = refs/heads/master:refs/heads/master
[remote "raptor"]
url = git:freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/raptor/*
push = refs/heads/*:refs/heads/*
[remote "freeems"]
url = git@github.com:FreeEMS/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/freeems/*
push = refs/heads/master:refs/heads/master
[remote "gitorious"]
url = git@gitorious.org:freeems-vanilla/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/gitorious/*
push = refs/heads/master:refs/heads/master
[remote "sourceforge"]
url = ssh://fredcooke@freeems.git.sourceforge.net/gitroot/freeems/freeems-vanilla
fetch = +refs/heads/*:refs/remotes/sourceforge/*
push = refs/heads/master:refs/heads/master
[remote "repoorcz"]
url = ssh://repo.or.cz/srv/git/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/repoorcz/*
push = refs/heads/master:refs/heads/master
# Others forks
[remote "olli"]
url = git://github.com/ohollmen/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/olli/*
[remote "seansrepo"]
url = git://github.com/seank/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/seansrepo/*
[remote "philj"]
url = git://github.com/johnsop1/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/johnsop1/*
[remote "mtxman"]
url = git://github.com/djandruczyk/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/djandruczyk/*
[remote "marcos"]
url = git://github.com/nitrousnrg/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/nitrousnrg/*
[remote "jaredh"]
url = git://github.com/jharvey/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/jharvey/*
[remote "johnhowe"]
url = git://github.com/johnhowe/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/johnhowe/*
[remote "simis"]
url = git://github.com/simeonveldstra/freeems-vanilla.git
fetch = +refs/heads/*:refs/remotes/simis/*
# Local inspection branches
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "seank"]
remote = seansrepo
merge = refs/heads/master
Note the remotes. The first batch are my public repos, they are all mirrors, I push to them as a set for redundancy. The next set is everyone else. I have no local branches pointing to these because it is not necessary the majority of the time. If I pull in a change and I'm unhappy with it, I can just reset --hard <my last revision> to remove the changes. If I have work in progress I can stash it and/or branch to keep the work separate from the incoming stuff until reviewed and merged/fast forward.
Code: Select all
git merge --ff-only otherbranch
Note, when setting up the url section of a remote, any remote, you have to be careful with the format:
Code: Select all
git://github.com/username/projectname.git - this is for READ ONLY access.
git@github.com:username/projectname.git - this is for read/write access, known as "push access".
Code: Select all
fetch = +refs/heads/*:refs/remotes/usernameOfRemoteOwner/*
fetch = +refs/heads/*:refs/remotes/remotename/*
I hope that helps and doesn't muddy the waters.
Fred.