Gentoo Archives: gentoo-portage-dev

From: Sebastian Pipping <sping@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] portage sources have moved from SVN to GIT
Date: Thu, 25 Mar 2010 00:55:50
In Reply to: [gentoo-portage-dev] portage sources have moved from SVN to GIT by Zac Medico
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@×××××××××××××××××××.org/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 'Dr. First Middle Last' git config --global '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: Resources (lots of recommendable ones) ======================================= Video Talks on Git ------------------ - (2007-05-03) Linus Torvalds "Source code control the way it was meant to be!" - (2007-10-12) Randal Schwartz "Git" - (2008-06-01) Scott Chacon "Getting Git" - (2008-07-09) Tommi Virtanen "Version Control for Developers" - (2008-07-09) Bart Trojanowski "Git the basics" - (2008-10-27) Johannes Schindelin "Contributing with Git" Online Reading -------------- Introductions ````````````` - Git Magic - The Git Community Book - Git from the bottom up - The Git Parable - Pro Git Task-oriented material `````````````````````` - Git Ready - Git Casts (actually short films) - Git FAQ Questions? ========== - Check #git on Freenode <-- very helpful - Mail me - Call me: +49 177 / 460 46 17 Thanks for reading! Sebastian Pipping