Skip to content

Instantly share code, notes, and snippets.

@dmerrick
Created June 9, 2009 21:53
Show Gist options
  • Save dmerrick/126824 to your computer and use it in GitHub Desktop.
Save dmerrick/126824 to your computer and use it in GitHub Desktop.
For Morgan: Example git sessions.
Im adding another file to this gist
dmerrick@dmerrick-dt-2 ~ $ cd /tmp
dmerrick@dmerrick-dt-2 tmp $ mkdir morgan-git
dmerrick@dmerrick-dt-2 tmp $ cd morgan-git/
/tmp/morgan-git
dmerrick@dmerrick-dt-2 morgan-git $ git init
Initialized empty Git repository in /private/tmp/morgan-git/.git/
dmerrick@dmerrick-dt-2 morgan-git $ vim README
dmerrick@dmerrick-dt-2 morgan-git $ cat README
This is an example readme file.
dmerrick@dmerrick-dt-2 morgan-git $ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# README
nothing added to commit but untracked files present (use "git add" to track)
dmerrick@dmerrick-dt-2 morgan-git $ git add README
dmerrick@dmerrick-dt-2 morgan-git $ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: README
#
dmerrick@dmerrick-dt-2 morgan-git $ git commit
[master (root-commit) 05147c1] I added a readme file.
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 README
dmerrick@dmerrick-dt-2 morgan-git $ git log
commit 05147c14af29f60cfc96718c793166b00f5b932b
Author: Dana Merrick <[email protected]>
Date: Tue Jun 9 16:51:54 2009 -0500
I added a readme file.
It doesn't say much. Hi Morgan!
dmerrick@dmerrick-dt-2 morgan-git $ git status
# On branch master
nothing to commit (working directory clean)
dmerrick@dmerrick-dt-2 ~ $ cd /tmp
dmerrick@dmerrick-dt-2 tmp $ git clone [email protected]:126824.git gist-126824
Initialized empty Git repository in /private/tmp/gist-126824/.git/
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
dmerrick@dmerrick-dt-2 tmp $ cd gist-126824/
/tmp/gist-126824
dmerrick@dmerrick-dt-2 gist-126824 $ ls
example git session
dmerrick@dmerrick-dt-2 gist-126824 $ head example\ git\ session
dmerrick@dmerrick-dt-2 ~ $ cd /tmp
dmerrick@dmerrick-dt-2 tmp $ mkdir morgan-git
dmerrick@dmerrick-dt-2 tmp $ cd morgan-git/
/tmp/morgan-git
dmerrick@dmerrick-dt-2 morgan-git $ git init
Initialized empty Git repository in /private/tmp/morgan-git/.git/
dmerrick@dmerrick-dt-2 morgan-git $ vim README
dmerrick@dmerrick-dt-2 morgan-git $ cat README
This is an example readme file.
dmerrick@dmerrick-dt-2 morgan-git $ git status
dmerrick@dmerrick-dt-2 gist-126824 $ echo "Im adding another file to this gist" >> another_file
dmerrick@dmerrick-dt-2 gist-126824 $ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# another_file
nothing added to commit but untracked files present (use "git add" to track)
dmerrick@dmerrick-dt-2 gist-126824 $ git add another_file
dmerrick@dmerrick-dt-2 gist-126824 $ git commit
[master 85e51ef] Added another file.
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 another_file
dmerrick@dmerrick-dt-2 gist-126824 $ git log
commit 85e51ef4dee3eea21827d974b0b730d2ef5867f2
Author: Dana Merrick <[email protected]>
Date: Tue Jun 9 16:57:48 2009 -0500
Added another file.
commit c13b7c351fbe796c0dcb95d538057b7240768869
Author: dmerrick <[email protected]>
Date: Tue Jun 9 14:53:26 2009 -0700
dmerrick@dmerrick-dt-2 gist-126824 $ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
dmerrick@dmerrick-dt-2 gist-126824 $ git push
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 337 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To [email protected]:126824.git
c13b7c3..85e51ef master -> master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment