git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Patch to make README more newbie-friendly

From
Matthias Urlichs <smurf@smurf.noris.de>
Date
Jul 14, 2005, 16:01 UTC
Message-ID
<pan.2005.07.14.16.00.53.434018@smurf.noris.de>
In-Reply-To
<42D5F10B.5050708@pason.com>
Hi, Jerry Seutter wrote:
> I'd also like to include stuff about branches, but I haven't gotten my 
> head wrapped around how they work yet.  cg-branch-add expects a location
> after the branch name and I'm not sure what to give it.

Cogito branch creation is based on the idea that you have a different archive _somewhere_else_ that you pull from, so it wants to store the source URL in .git/branches/<name>.

Git doesn't have that assumption; "git checkout -b <name>" simply creates a new branch and switches to it. However, the git branch idea came somewhat later, so there's a bit of a mismatch at the moment.

Simply switching branches isn't supposed to have any effect unless you actually have changes in different branches. I tend to work along these lines:

#!/bin/sh

cd /tmp rm -rf test.$$ mkdir test.$$ cd test.$$ git-init-db echo not-quite-empty >testfile cg-add testfile echo Created test | cg-commit git checkout -b one echo foo >>testfile echo added foo to testfile | cg-commit git checkout -b two master echo bar >> testfile echo added bar to testfile | cg-commit cg-diff -r one:two | cat git checkout master cg-merge one cg-merge two

The first merge fast-forwards your master tree to "one"; the second creates a conflict (lines were added at the same location) which you'll have to resolve (edit the file).

vi testfile echo Merged one and two | cg-commit gitk

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Apollo, the God of light, of reason, of proportion, harmony, number --
Apollo blinds those who press too close in worship. Don't look straight
at the sun. Go into a dark bar and have a beer with Dionysos, every now
and then. -- Ursula K. LeGuin
Previous: Jerry Seutter
Message 2 of 2 in “Patch to make README more newbie-friendly”
  1. Jerry SeutterJul 14, 2005
  2. Matthias UrlichsJul 14, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.