Created
August 13, 2017 06:05
-
-
Save znz/ebe07dc354f21b75e6a81fe22962586a to your computer and use it in GitHub Desktop.
git merge と git rebase の挙動の違いの確認
This file contains hidden or 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
#!/bin/sh | |
set -eux | |
mkdir /tmp/x | |
cd /tmp/x | |
git init | |
echo hello > hello.txt | |
git add . | |
git commit -m "Initial commit" | |
git remote add origin /tmp/repo | |
mkdir /tmp/repo | |
cd /tmp/repo | |
git init --bare | |
cd /tmp/x | |
git push -u origin master | |
git clone /tmp/repo /tmp/y | |
cd /tmp/y | |
git checkout -b hello | |
echo hello >> hello.txt | |
git commit -am "More hello" | |
git push origin hello | |
cd /tmp/x | |
git pull | |
git merge --no-ff origin/hello | |
git push | |
cd /tmp/y | |
git fetch origin | |
git checkout master | |
echo bye > bye.txt | |
git add bye.txt | |
git commit -m Bye | |
# git merge origin/master | |
# git rebase origin/master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment