[Cialug] git in structured environment

Colin Burnett cmlburnett at gmail.com
Wed Jul 9 23:27:17 CDT 2008


On Wed, Jul 9, 2008 at 11:07 PM, Lathrop Preston <lathrop at prestonfam.org> wrote:
>
> No worries. I'm going to keep reading. I'm still not sold on DVCS being as
> useful as described but until I have a project that uses it following a
> thread like this will help me get a handle on it.
>
> I'm just gonna lurk since this is clearly out of my experience (I use SVN a
> lot)

For what it's worth: give it a shot.  It doesn't require setting up a
server or anything, just installing git.

$ cd /tmp/
$ mkdir repo
$ cd repo/
$ git init
Initialized empty Git repository in .git/
$ echo "test" > foo.txt
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       foo.txt
nothing added to commit but untracked files present (use "git add" to track)
$ git add foo.txt
$ git commit -m "Initial version"
Created initial commit f587315: Initial version
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 foo.txt
$ echo "test2" >> foo.txt
$ git commit -a -m "More testing"
Created commit 780b9fc: More testing
 1 files changed, 1 insertions(+), 0 deletions(-)
$ git diff HEAD HEAD^ foo.txt
diff --git a/foo.txt b/foo.txt
index 9daeafb..b02def2 100644
--- a/foo.txt
+++ b/foo.txt
@@ -1 +1,2 @@
 test
+test2

------------------------------
I'm sure you can find better and more thorough tutorials online.  You
could then `git clone` to another directory (on another machine even),
update the repo on both machines, then `git push` or `git pull` to see
the commits get pushed or pulled.  When you're done just rm -rf the
directory.


Colin


More information about the Cialug mailing list