You can use a range to do that.
git log master..
If you've checked out your my_experiment branch. This will compare where master is at to HEAD (the tip of my_experiment).
You can use a range to do that.
git log master..
If you've checked out your my_experiment branch. This will compare where master is at to HEAD (the tip of my_experiment).
Note: if you limit that log to the last n commit (last 3 commits for instance, git log -3), make sure to put a space between 'n' and your branch:
git log -3 master..
Before Git 2.1 (August 2014), this mistake: git log -3master.. would actually show you the last 3 commits of the current branch (here my_experiment), ignoring the master limit (meaning if my_experiment contains only one commit, 3 would still be listed, 2 of them from master)
See commit e3fa568 by Junio C Hamano (gitster):
revision: parse "git log -<count>" more carefully
This mistyped command line simply ignores "
master" and ends up showing two commits from the currentHEAD:
$ git log -2master
because we feed "
2master" toatoi()without making sure that the whole string is parsed as an integer.Use the
strtol_i()helper function instead.
Videos
I find a lot of value in looking at how other's organize their codebase via digging through their commit history. Especially if I know how that person thinks already
I normally fork a repo, and open it into VScode. There's two well known extensions called (1) git history and (2) gitLens. But I don't know how to configure it the way I want easily. Youtube didn't have an answer either.
What I want to do is the following:
-
(A) Quickly see all changes and commits to one file
-
(B) See normal commit history to master branch for everything
For (A), I want the following workflow
-
Pick a file of interest.
-
Run a command
-
Pick the first commit done on file
-
Left side, see previous commit, right side see changes
-
Hit →
-
This shows next commit / diffchange
For (B), I want the following workflow
-
-
Show git history of entire master branch, similar to stackoverflow.
-
-
2. Freeze the pane at the top, kind of like what you do to microsoft-excel header-rows.
-
-
-
This shows commit message / history overview only. Fills up 10% of screen, with it's own vertical scrollbar.
-
-
-
3. Click a commit date, organized with most recent commits down bottom
-
4. Git diff log is shown, similar to what you view in github commit normally.
-
-
-
Fills up 90% of screen. Shows file changes top to bottom, left shows previous file, right side changes
-
-
Side note as well, if anyone knows how to do this or knows of a service -
I want to subscribe / watch a github repo, but only see commit changes only to master + a small preview of changes right in the email itself. As of now github shows you issue / PR requests, and just a commit name overview change.
This way I can just learn things faster since github is just a massive learning resource that I haven't really used properly