Я всегда делаю это с помощью простой визуальной проверки.
git log --all --oneline --graph --decorate
Это выведет очень хороший графический вид журнала git.Затем вы можете увидеть, основана ли ветвь на master
(или любой другой ветви), убедившись, что существует прямая линия *
, возвращающаяся к master
.
Например, на графике ниже вы можете видеть, что ветвь foo
(строка 3) основана на master
, а ветвь bar
(строка 1) основана на коммите 31aaea6
* 820ee6d (bar) Second commit not off master
* 9dd860f First commit not off master
| * 58e01a5 (foo) Recreate quiz from code
| * 725aa0e Add grading capability to quiz
| * 835dbb9 (origin/master, master) Implement the blog
| |\
|/ /
| * 01c1d1a Add the date to the blog post cards
| * f96960d Implement blog code syntax highlighting
| * d88b941 Show featured photos on the home page
|/
* 31aaea6 Add photoswipe image gallery