Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-portage-dev
Navigation:
Lists: gentoo-portage-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-portage-dev@g.o
From: Sebastian Pipping <sping@g.o>
Subject: Re: portage sources have moved from SVN to GIT
Date: Thu, 25 Mar 2010 01:55:01 +0100
On 03/24/10 09:07, Zac Medico wrote:
> If you have push access then you can commit something to the master
> branch like this:
> 
>   git clone git+ssh://git@.../proj/portage.git
>   cd portage
>   # edit files
>   git commit -a
>   git push origin master

Let me add a few more words and pointers:  let me get you started.


In this mail
============
- First thing to do

- On "origin"
- Not like Subversion:  Commits in Git
  - Committing versus pushing
  - Non-linear history
  - Commits and the staging area
- You in the future

- Resources  (lots of recommendable ones)

- Questions?


First thing to do
=================
After cloning you need to set up your commit identity:

  git config --global user.name 'Dr. First Middle Last'
  git config --global user.email 'nick@g.o'

Missing that up front is more work later.


On "origin"
===========
The "origin" Zac mentioned is the name of a remote - a URI Git can pull
from and (sometimes even) push to.  Soon you will work with more than
one remote: From personal experience I recommend to rename that remote
to something more meaningful, something reflecting the involved host at
best, e.g.

  git remote rename  origin  overlays-gentoo-org
                     ^old    ^new


Not like Subversion:  Commits in Git
====================================

Committing versus pushing
-------------------------
In Git you commit locally, even without network connectivity.
You do a few local commits and push them to the server in an extra step:

  git commit
  git commit
  ..
  git push  overlays-gentoo-org  master

In the beginning this separation may feel like a burden.
You'll soon appreciate to have it.


Commits and the staging area
----------------------------
When you do

  git commit

the content of the staging area (called "index" sometimes) is written
into a new commit object.

So modifying the staging area you change what goes into the next commit.
Commands like

  git add file3.txt
  git add -u
  git add -p
  git reset

do changes in the index for you.

The index is one of the core features and differences to other systems
including Subversion.  Understanding the index is essential to working
with Git.  Please study online material on that topic.


Non-linear history
------------------
Due to its distributed nature
- history is a directed acyclic graph (DAG) in Git, not a list
- revision IDs are SHA1s, not plain numbers

I can recommend emerging dev-vcs/gitg for a visual history browser.
Present is on top, moving down is moving into the past


You in the future
=================
Now that we're on Git you'll soon be able (and expected) to

  re-order
  merge
  split
  clean-up

past commits, i.e. re-write history.  The related commands are

  git commit --amend

and

  git rebase -i

See here if you want to know more:
http://book.git-scm.com/4_interactive_rebasing.html


Resources  (lots of recommendable ones)
=======================================

Video Talks on Git
------------------
- (2007-05-03)  Linus Torvalds
  "Source code control the way it was meant to be!"
  http://www.youtube.com/watch?v=4XpnKHJAok8

- (2007-10-12)  Randal Schwartz
  "Git"
  http://www.youtube.com/watch?v=8dhZ9BXQgc4

- (2008-06-01)  Scott Chacon
  "Getting Git"
  http://www.markrichman.com/2008/06/14/railsconf-git-talk/
  http://www.vimeo.com/1099027?pg=embed&sec=1099027

- (2008-07-09)  Tommi Virtanen
  "Version Control for Developers"
  http://blip.tv/file/1114793/

- (2008-07-09)  Bart Trojanowski
  "Git the basics"
  http://excess.org/article/2008/07/ogre-git-tutorial/

- (2008-10-27)  Johannes Schindelin
  "Contributing with Git"
  http://www.youtube.com/watch?v=j45cs5_nY2k


Online Reading
--------------

Introductions
`````````````
- Git Magic
  http://www-cs-students.stanford.edu/~blynn/gitmagic/

- The Git Community Book
  http://book.git-scm.com/

- Git from the bottom up
  http://ftp.newartisans.com/pub/git.from.bottom.up.pdf

- The Git Parable
  http://tom.preston-werner.com/2009/05/19/the-git-parable.html

- Pro Git
  http://progit.org/book/


Task-oriented material
``````````````````````
- Git Ready
  http://gitready.com/

- Git Casts  (actually short films)
  http://gitcasts.com/

- Git FAQ
  https://git.wiki.kernel.org/index.php/GitFaq


Questions?
==========
- Check #git on Freenode  <-- very helpful
- Mail me
- Call me: +49 177 / 460 46 17


Thanks for reading!



Sebastian Pipping



References:
portage sources have moved from SVN to GIT
-- Zac Medico
Navigation:
Lists: gentoo-portage-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
portage sources have moved from SVN to GIT
Next by thread:
Handling merge issues (on the case of prefix)
Previous by date:
portage sources have moved from SVN to GIT
Next by date:
Handling merge issues (on the case of prefix)


Updated Jun 13, 2012

Summary: Archive of the gentoo-portage-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.