Skip to content

Instantly share code, notes, and snippets.

@pbrewczynski
Created November 26, 2013 12:39
Show Gist options
  • Save pbrewczynski/7657683 to your computer and use it in GitHub Desktop.
Save pbrewczynski/7657683 to your computer and use it in GitHub Desktop.
pawel@debian:~/symbolicLinkTest$ git init
Initialized empty Git repository in /home/pawel/symbolicLinkTest/.git/
pawel@debian:~/symbolicLinkTest$ echo 'Hello world' > greeting
pawel@debian:~/symbolicLinkTest$ ls
greeting
pawel@debian:~/symbolicLinkTest$ git add greeting
pawel@debian:~/symbolicLinkTest$ git log
fatal: bad default revision 'HEAD'
pawel@debian:~/symbolicLinkTest$ git write-tree
870e3f1f32de1e81e954dadc36bd60f9ce0d3cd0
pawel@debian:~/symbolicLinkTest$ echo "Initial commit with greeting" | git commit-tree 870e3f
fa98a3e9cd258683be78d5ba913f47390e5b09b3
pawel@debian:~/symbolicLinkTest$ git log # HEAD not yet pointing
fatal: bad default revision 'HEAD'
pawel@debian:~/symbolicLinkTest$ git update-ref refs/heads/master fa98a3e
pawel@debian:~/symbolicLinkTest$ cat .git/refs/heads/master # it points to the commit i've created
fa98a3e9cd258683be78d5ba913f47390e5b09b3
pawel@debian:~/symbolicLinkTest$ echo 'Hello (again)' > greeting2
pawel@debian:~/symbolicLinkTest$ git add greeting2
pawel@debian:~/symbolicLinkTest$ git commit -m "Second commit"
[master 48e6499] Second commit
1 file changed, 1 insertion(+)
create mode 100644 greeting2
pawel@debian:~/symbolicLinkTest$ git log
commit 48e64993b1bd19fc63673c0d02dbaa6361f43fd4
Author: Pawel Brewczynski <[email protected]>
Date: Tue Nov 26 13:37:04 2013 +0100
Second commit
commit fa98a3e9cd258683be78d5ba913f47390e5b09b3
Author: Pawel Brewczynski <[email protected]>
Date: Tue Nov 26 13:33:04 2013 +0100
Initial commit with greeting
pawel@debian:~/symbolicLinkTest$ cat .git/refs/heads/master # Shows the LAST commit from working directory
48e64993b1bd19fc63673c0d02dbaa6361f43fd4
pawel@debian:~/symbolicLinkTest$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment