Skip to content

Instantly share code, notes, and snippets.

Created June 20, 2011 14:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/1035710 to your computer and use it in GitHub Desktop.
$ git init one
Initialized empty Git repository in /tmp/one/.git/
$ (cd one && echo one > one && git add one && git commit -m one)
[master (root-commit) 5428241] one
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 one
$ git clone --bare one two.git
Cloning into bare repository two.git...
done.
$ (cd one && echo two > two && git add two && git commit -m two)
[master abb3df4] two
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 two
$ git --git-dir=two.git fetch
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /tmp/one
* branch HEAD -> FETCH_HEAD
$ git --git-dir=one/.git log --pretty=format:%h
abb3df4
5428241
$ git --git-dir=two.git log --pretty=format:%h
5428241
^ expected same result for last two
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment