Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ mkdir orig
- $ cd orig
- $ echo "foo" >> foo.txt
- $ git init
- Initialized empty Git repository in .git/
- $ git add .
- $ git commit -m "initial commit"
- Created initial commit 6563aaf: initial commit
- 1 files changed, 1 insertions(+), 0 deletions(-)
- create mode 100644 foo.txt
- $ cd ..
- $ git clone orig copy
- Initialized empty Git repository in /Users/david/tmp/copy/.git/
- $ cd copy
- $ echo "second" >> second.txt
- $ git add .
- $ git commit -m "added second"
- Created commit a984537: added second
- 1 files changed, 1 insertions(+), 0 deletions(-)
- create mode 100644 second.txt
- $ git push
- Counting objects: 4, done.
- Compressing objects: 100% (2/2), done.
- Writing objects: 100% (3/3), 283 bytes, done.
- Total 3 (delta 0), reused 0 (delta 0)
- Unpacking objects: 100% (3/3), done.
- To /Users/david/tmp/orig/.git
- 6563aaf..a984537 master -> master
- $ cd ../orig
- $ git log
- commit a9845372d23010b86157dde953c1f74ef6f81701
- Author: David Chelimsky <dchelimsky@gmail.com>
- Date: Wed Apr 16 11:27:55 2008 -0400
- added second
- commit 6563aafe5d04e0315416a96841e6cfda878567ef
- Author: David Chelimsky <dchelimsky@gmail.com>
- Date: Wed Apr 16 11:27:20 2008 -0400
- initial commit
- $ cd ../copy
- $ git reset --hard 6563aafe5d04e0315416a96841e6cfda878567efHEAD is now at 6563aaf... initial commit
- $ git push
- To /Users/david/tmp/orig/.git
- ! [rejected] master -> master (non-fast forward)
- error: failed to push to '/Users/david/tmp/orig/.git'
- $ git push -f
- Total 0 (delta 0), reused 0 (delta 0)
- To /Users/david/tmp/orig/.git
- + a984537...6563aaf master -> master (forced update)
- $ cd ../orig
- $ git log
- commit 6563aafe5d04e0315416a96841e6cfda878567ef
- Author: David Chelimsky <dchelimsky@gmail.com>
- Date: Wed Apr 16 11:27:20 2008 -0400
- initial commit
- $ git fsck --full 6563aafe5d04e0315416a96841e6cfda878567ef
- $
Add Comment
Please, Sign In to add comment