Your Own Branch
On your own branches, you can do as you like. Please use your username in the name of any branch you plan to push to the Archer repository, like user/reason-for-branch. Also, make a file named README.archer in the top-level directory of your branch, and explain the branch's purpose in this file.
You can make a local branch very easily:
$ git clone --origin archer ssh://sourceware.org/git/archer.git $ cd archer $ git remote add gdb git://sourceware.org/git/binutils-gdb.git $ git fetch gdb $ git checkout gdb/master $ git checkout -b tromey/explosion-project
This makes a local branch. If you want to mirror this local branch on the archer server (which we encourage -- it is better to share), push it:
$ git push archer tromey/explosion-project
You should repeat this command any time you create new (local) commits.
As mentioned above, the file README.archer on a branch documents the purpose of the branch. You can read this file without checking out the branch using git show:
$ git show archer/tromey/explosion-project:README.archer
Merging from GDB
To merge from the gdb repository master to your archer branch:
$ cd archer $ git fetch gdb $ git checkout tromey/explosion-project $ git merge gdb/master # Possibly resolve conflicts by editor and then: # git commit -a
Merging multiple Archer branches
If you merge Archer branches together, you will get merge conflicts in the README.archer files. You can use a special merge function to handle this, see this email.
Extracting a patch from a branch
To extract a patch from a branch, use the git diff command:
$ git diff gdb/master...archer/tromey/charset
You can check out a specific branch using:
$ git clone --origin archer git://sourceware.org/git/archer.git $ cd archer $ git checkout tromey/explosion-project # Older GIT needs instead: git checkout --track -b tromey/explosion-project archer/tromey/explosion-project
When you close a branch, please delete it from archer.git.
You can also set up .git/config so that you can push this branch with a simple git push. Just edit that file, and add a line like this to the [remote "archer"] section:
push = <local branch name>:<remote branch name>
One example would be:
push = python:archer-tromey-python
So now instead of writing:
% git push archer python:archer-tromey-python
Then, if you are in the python branch (for this example) you can just type:
% git push
You can also add multiple push entries in .git/config to create multiple branch mappings.
To list existing branches:
% git branch
To list remote-tracking branches:
% git branch -r