how in git log view only master changelog
- User
how in git log view only master changelog
- Assistant
To view the changelog specifically for the
masterbranch ingit log, you can use the--branchesoption along with the name of the branch. Here are a few different ways you can do this:-
Basic Command to Show
masterCommits: If you want to see the commits that are only on themasterbranch, run:bashgit log master -
Filtering with
--oneline: If you prefer a more concise view, you can use the--onelineoption:bashgit log --oneline master -
Showing Commits That Are in
masterBut Not in Other Branches: If you want to see commits that are exclusive to themasterbranch (i.e., not present in any other branch), you can use:bashgit log --no-merges --first-parent masterThis ignores merge commits and shows a linear history.
-
Using
--graphfor a Visual Representation: To visualize the commit history formaster, you can include the--graphoption:bashgit log --graph --oneline master -
Specify a Range: If you're interested in commits between two points or tags, you can specify a range:
bashgit log master..commit-hash
Replace
commit-hashwith the actual commit hash you are comparing against.Example:
To view the last 5 commits exclusively on
master, you could do:bashgit log -n 5 --oneline masterThese commands will help you focus your Git log to show only the changelog related to the
masterbranch. -