This is a very basic overview of setting up a git repo and then working with it from 2 stations. This will be reviewed in class if I can make it work this time!

Initialize the a central repo on a host (the lab machines?)


buzbee@shell:~> git init --bare repo.git
Initialized empty Git repository in /home/grads/buzbee/repo.git/

(Recommended, but not shown) Setup groups so that each user has a different account

Clone the repo on one workstation

root@benbuzbee:~# git clone buzbee@shell.cs.fsu.edu:/home/grads/buzbee/repo.git
Cloning into repo...
The authenticity of host 'shell.cs.fsu.edu (128.186.122.11)' can't be established.
RSA key fingerprint is 63:60:9e:bf:ac:b6:51:2e:b5:6f:7a:6b:7f:24:83:df.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'shell.cs.fsu.edu,128.186.122.11' (RSA) to the list of known hosts.
buzbee@shell.cs.fsu.edu's password:
stdin: is not a tty
warning: You appear to have cloned an empty repository.
root@benbuzbee:~# ls
dead.letter  repo  sshd_config  ts3  userman.sh
root@benbuzbee:~# cd repo
root@benbuzbee:~/repo#

Add your first file

root@benbuzbee:~/repo# echo "hi" > hello.txt
root@benbuzbee:~/repo# git add .
root@benbuzbee:~/repo# git commit -m "Added a hello!"
-bash: !": event not found
root@benbuzbee:~/repo# git commit -m "Added a hello"
[master (root-commit) e696be6] Added a hello
 Committer: root 
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

If the identity used for this commit is wrong, you can fix it with:

    git commit --amend --author='Your Name '

 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 hello.txt
root@benbuzbee:~/repo# git push origin master
buzbee@shell.cs.fsu.edu's password:
stdin: is not a tty
Counting objects: 3, done.
Writing objects: 100% (3/3), 218 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To buzbee@shell.cs.fsu.edu:/home/grads/buzbee/repo.git
 * [new branch]      master -> master

Clone the repo on a second workstation

root@mch202-instructor:~# git clone buzbee@shell.cs.fsu.edu:/home/grads/buzbee/repo.git
Cloning into 'repo'...
The authenticity of host 'shell.cs.fsu.edu (128.186.120.3)' can't be established.
RSA key fingerprint is 63:60:9e:bf:ac:b6:51:2e:b5:6f:7a:6b:7f:24:83:df.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'shell.cs.fsu.edu,128.186.120.3' (RSA) to the list of known hosts.
buzbee@shell.cs.fsu.edu's password:
Permission denied, please try again.
buzbee@shell.cs.fsu.edu's password:
stdin: is not a tty
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.


root@mch202-instructor:~# cd repo
root@mch202-instructor:~/repo# cat hello.txt
Hi

Make changes...

root@mch202-instructor:~/repo# echo "Bye" > hello.txt
root@mch202-instructor:~/repo# git add .
root@mch202-instructor:~/repo# git commit -m "Nope, bye"
[master 5bf4de2] Nope, bye
 Committer: root 
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 file changed, 1 insertion(+), 1 deletion(-)
root@mch202-instructor:~/repo# git push
buzbee@shell.cs.fsu.edu's password:
stdin: is not a tty
Counting objects: 5, done.
Writing objects: 100% (3/3), 249 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To buzbee@shell.cs.fsu.edu:/home/grads/buzbee/repo.git
   e696be6..5bf4de2  master -> master

Update the first workstation's copy

root@benbuzbee:~/repo# git pull
buzbee@shell.cs.fsu.edu's password:
stdin: is not a tty
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From shell.cs.fsu.edu:/home/grads/buzbee/repo
   e696be6..5bf4de2  master     -> origin/master
Updating e696be6..5bf4de2
Fast-forward
 hello.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
root@benbuzbee:~/repo# cat hello.txt
Bye


root@benbuzbee:~/repo# git log hello.txt
commit 5bf4de25b2e3c9a69f138b577f63b8a07abcd3e4
Author: root 
Date:   Mon Sep 10 17:49:53 2012 -0400

    Nope, bye

commit e696be6f5edc376f191970feb9f84296043e3208
Author: root 
Date:   Mon Sep 10 17:43:18 2012 -0400

    Added a hello