From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: Workflow example for remote repository use of GIT
Date: Tue, 28 Nov 2006 17:18:09 +0100 [thread overview]
Message-ID: <ekhncj$1be$1@sea.gmane.org> (raw)
In-Reply-To: 89b129c60611280708x10a9c42fia23e6b7770971838@mail.gmail.com
Sean Kelley 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?
>
> Thanks,
>
> Sean
>
>
>
> Always work out of master
>
> git checkout master
This conflicts a bit with later "Create a topic branch" statement.
The statement should be I think twofold: "Never work out of tracking
branches" (if you use separate remotes, git takes care of that for
yourself), and for typical workflow "Always work out of master
or merge changes into master".
This of course deopends on the structure of your repo. For example,
how many development branches are there. Git repository uses four
development branches: 'maint' (maintenance, stable, bugfixes),
'master' (trunk, main development, stable), 'next' (development)
and 'pu' (proposed updates, a kind of topic branch digest).
> Getting The Latest Upstream Code into master
>
> git pull origin master
It always is "merge into current branch".
Please read what this mean in git-pull(1):
? A parameter <ref> without a colon is equivalent to <ref>: when
pulling/fetching, so it merges <ref> into the current branch
without storing the remote branch anywhere locally.
So what "git pull origin master" do is to fetch _single_ remote branch
'master' from remote (repository) 'origin' _without_ storing it anywhere
locally (with separate remotes it would be 'remotes/origin/master',
without separate remotes it would be 'origin'), and merge it into _current_
branch.
What you usually want to do, when you are on branch "master", is
git pull origin
or even
git pull
> Create a topic branch for your development work
>
> git checkout -b <new topic branch name>
One might want to create topic branch off other commit than HEAD,
using
git checkout -b <new topic branch name> <branch point>
> Do your development in the topic branch
>
> edit/debug/test
>
> Committing Changes
>
> git commit -a
Depending on your project policy, it might be "git commit -a -s",
i.e. add signoff line.
> Switch back to master
>
> git checkout master
>
> Update the master branch from origin again
>
> git pull origin master
The same comment as above.
By the way, this is _not_ CVS, you can merge your topic branch first,
_then_ pull from origin.
> Now Merge your topic branch
>
> git pull . <topic branch to merge into current branch>
I'd point out that '.' means current repository here.
> How do I push my changes to the original repository?
>
> git push origin master
Probably (and better) just "git push origin" if everything is set up
correctly.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
prev parent reply other threads:[~2006-11-28 16:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-28 15:08 Workflow example for remote repository use of GIT Sean Kelley
2006-11-28 15:15 ` Johannes Schindelin
2006-11-28 15:25 ` Shawn Pearce
2006-11-28 16:18 ` Jakub Narebski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='ekhncj$1be$1@sea.gmane.org' \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).