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

Re: Workflow example for remote repository use of GIT

From
Shawn Pearce <spearce@spearce.org>
Date
Nov 28, 2006, 15:25 UTC
Message-ID
<20061128152524.GA28337@spearce.org>
In-Reply-To
<89b129c60611280708x10a9c42fia23e6b7770971838@mail.gmail.com>
Sean Kelley <sean.v.kelley@gmail.com> wrote:
> I have been trying to set-up a workflow for developers in my group
> using GIT. I came up with this simplified flow.  Do you all see any
> problems with this approach?
...
Show 11 quoted lines
> Always work out of master
> 
>  git checkout master
> 
> Getting The Latest Upstream Code into master
> 
>  git pull origin master
> 
> Create a topic branch for your development work
> 
>  git checkout -b <new topic branch name>
That can be streamlined slightly:
  git fetch
  git checkout -b <new-topic> origin
as fetch would by default download from remote 'origin' and update
the tracking branches.  And of course developers may not want to
create their new branch from origin, e.g. if they are doing a bug
fix to an earlier release of the product.  I think its a good habit
to be in to always specify the origination point for a branch when
creating it.
 
Show 7 quoted lines
> Do your development in the topic branch
> 
>  edit/debug/test
> 
> Committing Changes
> 
>  git commit -a
Sure, that's CVS-like and rather simple.
 
Show 11 quoted lines
> Switch back to master
> 
>  git checkout master
> 
> Update the master branch from origin again
> 
>  git pull origin master
> 
> Now Merge your topic branch
> 
>  git pull . <topic branch to merge into current branch>
Yes, that works and will get you a merge message like
  Merge branch 'my-topic' into master

which is probably what you want if there actually was a merge. If there wasn't (its just a fast-forward) then you won't get the merge message. It also has the nice property that the "trunk (if there is such a thing)" is the first parent in every merge, with the topic(s) in the other parents.

Though I tend to just pull the origin into the current branch and push that directly, e.g.:

  git pull origin master
  git push origin HEAD:master
Previous: Johannes SchindelinNext: Jakub Narebski
Message 3 of 4 in “Workflow example for remote repository use of GIT”
  1. Sean KelleyNov 28, 2006
  2. Johannes SchindelinNov 28, 2006
  3. Shawn PearceNov 28, 2006
  4. Jakub NarebskiNov 28, 2006

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.