Generally it's a bad idea to work in the master branch. In git, master is the equivalent of CVS's HEAD, but branches are really easy to use and merge back into the HEAD branch. Also, because git is distributed, it's an easier workflow to keep the master branch (or whatever branches you share with the upstream repo) 'clean' and perform merge work in your topic branch.
git clone firstname.lastname@example.org:pfsense/myname-mystuff.git mydirectory cd mydirectory git checkout -b RELENG_1_2 origin/RELENG_1_2 # work, work, work, patch, patch, patch git commit -a # type a description for the commit git push
git clone https://github.com/pfsense/pfsense.git cd mainline # cd into the repo. git status # On branch master - note that the default is "master" which is similar to HEAD in CVS speak.
git clone email@example.com:pfsense/pfsense.git
git checkout -b RELENG_1_2 origin/RELENG_1_2
would look like:
(billm) pfsense-git$ git checkout -b RELENG_1_2 origin/RELENG_1_2 Branch RELENG_1_2 set up to track remote branch refs/remotes/origin/RELENG_1_2. Switched to a new branch "RELENG_1_2" (billm) pfsense-git$
Subsequent checkouts (or branch changing) will look like
git checkout RELENG_1_2
http://github.com/guides/keeping-a-git-fork-in-sync-with-the-forked-repo is a good doc to read on this
On your local repository you need to:
# Add the remote tracking branch 'mainline' (example only, use a name of your choice)
git remote add mainline http://gitweb.pfsense.org/pfsense/mainline.git
# Fetch the mainline
git fetch mainline git merge mainline/master
# If you've done everything normally the 'origin' branch will point at your 'myclone' Gitorious repository
git push origin
git commit -a git fetch git rebase origin
You can fix messages like "Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded" by commiting your work, and then rebasing.
If you find that after "git fetch", you cannot "git rebase origin" because it says that files need updating, you may need to reset like so:
git fetch git reset --hard origin
Be aware that you'll lose your local changes, but when I saw this error they were actually files I had never touched, and checking them out again did not help.