In GitHub, is there a way to see all (recent) commits on all branches? - github

In GitHub, is there a way to see all recent commits on all branches. It would be best in reverse chronological order.
Maybe I'm snoopy, but I'd like to be able to see what my developers have been up to recently, at least in terms of commits to the repository on github. So far the closest I've seen is the network graph, which is certainly very useful.

Please note: this is not the right answer, although I hope it continues to be useful. NB it has been made a "Community" answer so I don't receive any points from upvotes
To see all commits for a specific branch (so this does NOT actually answer the original question, which is to see commits across all branches):
Click "Code" (left-most tab) on the main page for the repository. Under those 4 buttons ("master", "Go to file", "Add file", "Code") there is a blue rectangle. At the right end of that is a clock icon and a number. If the viewport of your browser is wide enough it even includes (hurrah) the word "commits". This is a link. Click and ENJOY!!!
NB the URL for this page is like this: https://github.com/myProfile/myRepo/commits/master

This is an old feature of GitHub but not really that intuitive.
Using the GitHub website:
Click a project
Click the 'Insights' tab (moved inside the Meatballs menu)
Click 'Network'
Click on the 'node/circle' for each commit to go to that commit.
Diagram below.
Additionally, you can drag to the left to see all commits throughout time for all forks and branches.

I guess there is no any button which shows you a complete list of commits. If you want to list all commits in a repo, you could browse the following URL:
https://github.com/username/repository/commits
You can view the list of commits by adding the word commits (in plural) at the end of repo URL .
Optionally, you could add some query string to narrow the results in the list. For example:
https://github.com/username/repository/commits?author=johndoe
Update
Thanks to #lii I update this post:
If you want to view all commits in a branch, browse the following URL:
https://github.com/username/repository/commits/branch-name
And you could narrow the list of commits by browsing the following URL:
https://github.com/username/repository/commits/branch-name?author=johndoe

The user interface in GitHub does not currently support a way to see your commits in a branch from the code tab. However, I observed that when I select a branch from the branch selector dropdown, I see the following URL:
// This shows me all commits from all users in the branch called "2.2-stable"
https://github.com/jquery/jquery/commits/2.2-stable
If I click on a username in the list of commits, I observe the following URL:
//This shows me the list of commits from the user "mgol" in the master branch (default branch)
https://github.com/jquery/jquery/commits?author=mgol
So, I thought to myself, why not try to add the query string ?author=mgol to the URL that showed commits on a specific branch:
Solution:
// Show me the list of commits from the user "mgol" on the branch called "2.2-stable"
https://github.com/jquery/jquery/commits/2.2-stable?author=mgol
Again, the user interface has no button that lets you see this view (to the best of my knowledge) but you can manipulate the query string to filter only what you want to see.

Since the 'Insights'/'Network' solution is only available for public/GitHub Team repositories, I found a method that works for both private and public repositories.
github.com/username/reponame/branches
Next to the currently selected branch dropdown, there is a link to github.com/username/reponame/branches
This gives you a (clickable) list of all branches with their most recent commits, in chronological order, as asked in the question:
Although this method does not show all commits (only the most recent one) across all branches, this does allow you to check which of the (new) branches has been updated most recently, and further your investigation. I use this all the time.

Look here: Github API: Retrieve all commits for all branches for a repo this is the only options.
On website you can see only branch specific commits - you need to manually switch between them.
Bitbucket allows to see all commits on all branches.

If viewing this from github.com is not a hard requirement, you can use git:
Clone the project locally, then run the following to show the list of all commits from all branches, sorted by date in descending order:
git log --oneline --all --since="Jan 20 2022"
where --since (and --until) allows you to specify a time range and --all displays commits from every branch including remotes. Alternatively you can replace --all with --branches=*.
You can also display the date and authors with something like this:
git log --oneline --pretty="%C(yellow)%h %C(cyan)%cd %C(magenta)%aN%C(auto)%d %Creset%s" --date-order --date=format:"%y%m%d-%H%M" --all --since="Jan 20 2022"
You can also add --graph switch to get a more structured view instead of a plain list.
Please note: dates may not be reliable to track work: some operations will modify history, e.g. a rebase may update the date of old commits to the date of the rebase, squash may keep the oldest date only, a commit date may be modified arbitrarily, etc.

There is no way to attain that within the original GitHub. But there is a work around.
You could use Le Git Graph (read as legit graph), a browser extension that does exactly this.
Install the extension from here : https://chrome.google.com/webstore/detail/le-git-graph-commits-grap/joggkdfebigddmaagckekihhfncdobff
It will add a new "commits" section to every GitHub repo you open. Open the commits graph and there, all commits across branches will be listed along with the git graph.
Hope it helps!
An upvote would be highly appreciated!

The actions tab has all recent activities done on a repo for all branches.

The way I have my repos setup, each developer has a user.git account. I recommend doing the following:
git fetch --all
This fetch updates all the local copies of remote branches but doesn't create new local branches of these tracking remote branches. If you have local branches of all your developer's branches, you will want to run:
git pull --all
So what you need to do is git fetch --all and then git pull --all. I hope this helps.
Lastly, you can also do git remote update which is the same as git fetch --all

best way to access all commit of a repository is
install app of the GitHub on your PCs
clone repo with that
on the history tab you can find all commit
but you need patient and scroll down on this tab ;)
have a good time

Simply run the following command and keep on pressing enter as you see the details of each commit step by step
git log

Related

How can I view the differences between commits filtered by contributors on GitHub?

I'm not sure if GitHub questions are off-topic, but I'll take the chance.
Day 1 - I created a new branch called feature and added changes.
Day 2 - I ran git pull origin master
Day 3 - I created a PR and I merged to master
Day 4 - I continued working on branch feature and again, I added some changes.
Day 5 - ... and so on...
While I wrote the code, another contributor wrote with me on the same branch (feature)).
I and another contributor wanted to review our work from the first commit to last. In order to do so, I navigated to:
https://github.com/<organization>/<repo>/compare/<base>...<target>
base = our initial commit
target = our last commit
Well, it didn't go quite as planned. We noticed that a lot of the changes were not made by us, but by different contributors (11 in fact):
I get that it happened because a lot of commits that weren't written by us has been made between base...target. So I want to know, is there a way I can filter the commits by specific contributors? or, is there any other way we could see only our changes?
For
You can filter, if your github repo is
https://github.com/name/repo/
you can filter by author on a specific branch
https://github.com/name/repo/commits/feature?author=john.doe
A real example:
https://github.com/utix/util-linux/commits/cal_column?author=karelzak
https://github.com/utix/util-linux/commits/cal_column
Click on "Commits 97" (on your picture) and you will see all commits from this GitHub project. You can also see all users who have ever changed your project. If you then click on a user name, all commits of this user are displayed in this project. So you can click on your username and the other contributor's username, and you'll see all the commits from the selected user both times.
I hope you come out with my explanation

How do I pull a specific version of a branch to the master?

This question pertains to my workflow using github. My colleague sent me a pull request and kept advancing the branch he was working in with new commits? I want to pull the commits related to the pull request, but the pull request now has the commits too. I searched for solutions and kept being led to the "rebase" command. Regrettably, that command is too complicated for me, plus I use tortoiseSVN as my interface to github. I had some solutions using revert, but they were all un-elegant and there had to be something easy. Also the last time I tried a revert, I had some conflicts with commits that no longer existed because of the revert.
My colleague got a response from a github "ask a human". I am reporting the solution here to help other users.
Navigate to the branch with the work to be pulled.
Navigate to the commit history for the branch and identify the point in that history that you want to pull into the master.
Click on the button on the right marked "<>" == "Browse the repository at this point in the history".
Click on the branch pull down menu and create a new branch. This will create a new branch at that point in the history that you want to pull into the master.
Create and execute a pull request to merge that branch into the master.
Too easy. I don't understand how I didn't run across an example of this workflow. I hope I save someone else the time and headaches that I spent.

Closing GitHub feature branches while retaining labels in Network Graph

I love GitHub's "Network Graph" view. I like how it can give me an overview of the progression of a repository over time:
Unfortunately, I've noticed one problem. When I'm done merging branches into master, if I delete the original feature branch from remote (GitHub), the little branch name labels disappear. This results in a graph that looks like this:
I know I can hover over the commits to see the commit message, but it's so much more helpful (to me, at least) to have the branch name labels to provide a general indication of what I'm looking at.
Is there a way to delete these branches from remote and have this graph retain its labels? Or, is there a better approach that I'm overlooking?
There is no way to keep the name of a deleted branch and remember it's last pointed commit in Git.
In some Git GUIs, they show tag names like this, so you could add a tag to the last commit of a given branch. But GitHub doesn't show tags like that.
So, in GitHub the only way to achieve what you seek is not deleting branches.
I rename my merged branches "zCLOSED-oldname" so that they still have references, but sort to the bottom of the Branch pulldown list.
Unfortunately, you can't rename directly in GitHub, so you have to rename locally, push the "new" branch, and then delete the original Branch name from GitHub.

How can I view the history of a single branch in EGit for eclipse

When reviewing code in eclipse using EGit plugin, before merging it to the develop branch, you switch to the branch and see what files changed with the commits on that branch. For this I would like to see -only- the commits to the current checked out branch. When using Team -> Show in History, I get the complete history across all branches.
How can I view only the commits to the current checked out branch, instead of having to search trough the complete GIT history to find the relevant commits?
Using review tools like Gerrit are not an option.
You can check the filter button in the History View:
All Branches
This toggle activates the "All Branches" mode.
By default, only those commits are shown in the commit log that can be reached from the currently checked out commit, i.e. the Commit Graph ends with the currently checked out commit and newer commits are not shown.
If this button is down, all commits will be shown in the commit log.
This is illustrated in the following picture from our example. The branch "beforeSplit" is currently checked out; by activating the toggle, the newer branches will become visible:
And you need to combine that with:
"Additional Refs" toggles the visibility of certain Refs created during actions like fetch, rebase, merge, for example FETCH_HEAD, ORIGIN_HEAD... This can be helpful to remove clutter from the history view.
You might need to un-check the "Additional Ref" option. please see the attached image.

Is it possible to setup github pull requests to use rebase instead of merge?

When I create a pull request on Github, it gives me a nice 'Merge' button on the pull request page. Is it possible to configure this button to do a rebase instead of a merge?
It may be interesting to note, despite the question being ages old, that Github finally added this option!
The whole story is here:
https://github.com/blog/2243-rebase-and-merge-pull-requests
Keep in mind that this option does change your commits, setting the committer to the current user. Also the commit date changes. Thus, the commit hashes change.
No, it always does a git merge --no-ff, and the github website doesn't have access to your local configuration.