-
-
Save x-yuri/888261d182fdab92040760138ea10a22 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
#!/bin/sh -eu | |
mkcommit() { | |
echo "$1" > "$1"; git add "$1"; git commit -m "$1" | |
} | |
git_log() { | |
git --no-pager log --graph --oneline --all | |
} | |
rm -rf a a.git a2.git | |
mkdir a | |
(cd a | |
git init | |
mkcommit ma | |
) | |
git clone --bare a a.git | |
git clone --bare a a2.git | |
rm -rf a | |
mkdir a | |
(cd a | |
git init | |
git remote add r ../a.git | |
git fetch r | |
# git remote add origin ../a2.git | |
git reset --hard r/master | |
git config push.default current | |
mkcommit mb | |
set -x | |
git push | |
cat .git/config | |
) |
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
... | |
+ git push | |
Enumerating objects: 4, done. | |
Counting objects: 100% (4/4), done. | |
Delta compression using up to 8 threads | |
Compressing objects: 100% (2/2), done. | |
Writing objects: 100% (3/3), 265 bytes | 265.00 KiB/s, done. | |
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 | |
To ../a.git | |
ec99458..c611b6b master -> master | |
+ cat .git/config | |
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
[remote "r"] | |
url = ../a.git | |
fetch = +refs/heads/*:refs/remotes/r/* | |
[push] | |
default = current |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment