Created
February 6, 2013 12:17
-
-
Save dmedvinsky/4722226 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir /tmp/test | |
cd /tmp/test | |
git init | |
git remote add origin git@host:test1.git | |
git remote set-url --add origin git@host:test2.git | |
touch file | |
git add file | |
git commit -m 'commit 1' | |
git push origin master | |
echo change 1.1 > file | |
git commit -m 'commit 2.1' | |
git remote set-url --delete origin git@host:test2.git | |
git push origin master | |
git remote set-url --add origin git@host:test2.git | |
git log --oneline | |
# ee4eae9 commit 2.1 | |
# 5014d02 commit 1 | |
git reset --head HEAD~ | |
echo change 1.2 > file | |
git add file | |
git commit -m 'commit 2.2' | |
git log --oneline | |
# 046151c commit 2.2 | |
# 5014d02 commit 1 | |
git push origin master | |
# To git@host:test1.git | |
# ! [rejected] master -> master (non-fast-forward) | |
# error: failed to push some refs to 'git@host:test1.git' | |
# Counting objects: 5, done. | |
# Writing objects: 100% (3/3), 247 bytes, done. | |
# Total 3 (delta 0), reused 0 (delta 0) | |
# To git@host:test2.git | |
# 5014d02..046151c master -> master | |
git log --oneline | |
# 046151c commit 2.2 | |
# 5014d02 commit 1 | |
git pull --rebase origin master | |
git log --oneline | |
# ee4eae9 commit 2.1 | |
# 5014d02 commit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment