查看本地分支
git branch
查看远程分支
git branch -r
checkout 远程分支并在本地创建新分支
git checkout -b ${local_branch} ${remote_repo}/${remote_branch}
例如 git checkout -b cassandra-3.3 origin/cassandra-3.3
查看tag
git tag -l
checkout tag
git checkout tags/${target_tag}
git checkout tags/${target_tag} -b ${local_branch}
比较commit,并创建patch
git diff commit1_hash commit2_hash > your.patch
应用patch
git apply <yourpath>