5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

天まで届けmergeはしご

Last updated at Posted at 2016-10-22
$ mkdir ladder

$ cd ladder/

$ git init
Initialized empty Git repository in ~/ladder/.git/

$ git commit --allow-empty -m 0
[master (root-commit) 899c146] 0

$ git checkout -b branch
Switched to a new branch 'branch'

$ git commit --allow-empty -m 1
[branch 5646b01] 1

$ for i in {2..10}; do
>   if [ `expr $i % 2` -eq 0 ]; then
>     git checkout master
>     git merge --no-ff -m `[ $i -eq 10 ] && echo ten || echo $i` branch
>   else
>     git checkout branch
>     git merge --no-ff -m $i master
>   fi
> done
Switched to branch 'master'
Already up-to-date!
Merge made by the 'recursive' strategy.
Switched to branch 'branch'
Already up-to-date!
Merge made by the 'recursive' strategy.
Switched to branch 'master'
Already up-to-date!
Merge made by the 'recursive' strategy.
Switched to branch 'branch'
Already up-to-date!
Merge made by the 'recursive' strategy.
Switched to branch 'master'
Already up-to-date!
Merge made by the 'recursive' strategy.
Switched to branch 'branch'
Already up-to-date!
Merge made by the 'recursive' strategy.
Switched to branch 'master'
Already up-to-date!
Merge made by the 'recursive' strategy.
Switched to branch 'branch'
Already up-to-date!
Merge made by the 'recursive' strategy.
Switched to branch 'master'
Already up-to-date!
Merge made by the 'recursive' strategy.

結果

ten

届いた。

5
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?