Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 6

How to only view commits created on a fork or branch?

Solved! Go to Solution.

So, if I have a project that was forked, and I want to view only commits added to the fork, and not commits from the original project; how can I do that?

Or more generally, view only commits added on the current branch? e.g. branch 'feature' was created from master, and I'd like to see a list of all commits created on feature, but not the commits from master?

5 Replies
Commander Lvl 1
Message 2 of 6

Re: How to only view commits created on a fork or branch?

Hi @iCodeSometime,


This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information.

As you’ll notice, your Topic is now in the How to use Git and GitHub board. No action is needed on your part; you can continue the conversation as normal here.

Let me know if you have any other questions or if I can help with anything else.

Cheers!

Copilot Lvl 3
Message 3 of 6

Re: How to only view commits created on a fork or branch?

Thanks.. Sorry, this is my first time using the forum

Community Manager
Message 4 of 6

Re: How to only view commits created on a fork or branch?

You can see the commits that exist only on the target branch but not on the base branch with the following (rather long) command:

 

git log --decorate --pretty=oneline --abbrev-commit --no-merges --first-parent base..target

If you want to see what the various options do, you can view this command on explainshell.com.

 

I hope that helps!

Copilot Lvl 3
Message 5 of 6

Re: How to only view commits created on a fork or branch?

Cool, thanks! I gather there's no way to do this in GitHub then?
Solution
Moderator
Message 6 of 6

Re: How to only view commits created on a fork or branch?

Hi @iCodeSometime,

Actually you should be able to view all the commits for a branch on github.com. To do so, you just need to select the branch from the "Branch" dropdown.


branch dropdown.png

This will put you directly on the branch whose commits you want to view. Then you can select "Compare"

Compare.png

This will allow you to view a list of all the commits made for that branch.

Hope this helps! Cheers!


Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!