Posts

Showing posts with the label log

How to list only commits which was made after branch was splitted(checkouted)

To list only the commits made on your current branch after it split from a parent branch, use the double-dot ( .. ) syntax with git log . 💻 The Best Commands Run this command from your current branch:  git log main..HEAD If you prefer a clean, single-line overview:   git log --oneline main..HEAD (Note: Replace main with master , develop , or whatever the name of your parent branch is.) 🔍 How It Works The .. operator acts as a set subtraction tool.  main..HEAD means: "Show me all commits reachable from HEAD (your current branch), but exclude any commits that are reachable from main ." This leaves you exactly with the new commits added to your feature branch since the day you used git checkout -b .   💡 Advanced Options Depending on your workflow, you can add flags to handle specific scenarios: Exclude Merge Commits: If you have pulled or merged other branches into your feature branch and only want to see your unique work, add --no-merges : git log main..HEAD...

Git tips, tricks and some explanations

Image
Git tips, tricks and some explanations Полезные встроенные графические инструменты (для винды): gitk - Графический просмотрщик для коммитов git gui - Чё-то наподобие среды для GIT (ну GUI есть гуй :-) Создаём псевдонимы: $ git config --global alias. ch checkout $ git config --global alias. br branch $ git config --global alias. co commit $ git config --global alias. st status $ git config --global alias. visual '!gitk'  Пример использования: $ git st Чтобы создать ветку и сразу же перейти на неё, вы можете выполнить команду: $ git checkout -b имя_ветки Допустим, вы разобрались с проблемой  hotfix   и готовы объединить эту ветку и свой master . Чтобы сделать это, мы сольём ветку имя_ветки в ветку master . Всё, что вам нужно сделать, — перейти на ту ветку, в которую вы хотите слить свои изменения, и выполнить команду git merge : $ git checkout master (переход в master) $ git merge имя_ветки (сливание[объединение]) Вы можете удалить ветк...