The Difference Between ∼ and ^

Learn the difference between "~" and "^".

These two operators are used in a very similar way, so the difference between the two can be obscure.

Understanding differences by example

Here’s a demonstration of it in its simplest form with another example:

1	mkdir -p lgthw_bisect_2
2	cd lgthw_bisect_2
3	git init
4	touch afile
5	git add afile
6	git commit -am 'Initial commit'
7	git branch abranch
8	git checkout abranch
9	echo 'abranch addition' >> afile
10	git commit -am 'abranch addition'
11	git checkout master
12	echo 'master addition 1' >> afile
13	git commit -am 'master addition 1'
14	echo 'master addition 2' >> afile
15	git commit -am 'master addition 2'
16	git merge -X ours -m merged abranch