git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git command history

From
BMbalaji marisetti <balajimarisetti@gmail.com>
Date
Mar 25, 2019, 15:40 UTC
Message-ID
<CAKcrOwfz=W+HwAZUDCo9u=prH-orUph0f-H5bXZ14pcyjFTiFA@mail.gmail.com>
In-Reply-To
<f52ef736-9d58-a6cf-e3b0-501b065ae325@jeffhostetler.com>
Thanks Johannes, and Jeff for your responses
> you probably meant the worktree, not the repository, I assume

You introduced me to a new feature :) I didn't know about this "worktree" feature. Thanks.

> Trace2 will let you see all of the git commands,
> the alias expansions, and any shell commands launched
> by git. If those shell commands also run git commands,
> they will be listed too.

Currently, I'm going through the code and documentation of this feature. I'll see how I can leverage this feature to work for my usecase.

- Balaji M
On Fri, Mar 22, 2019 at 6:49 PM Jeff Hostetler <git@jeffhostetler.com> wrote:
Show 42 quoted lines
>
>
>
> On 3/22/2019 8:46 AM, Johannes Schindelin wrote:
> > Hi Balaji,
> >
> > On Tue, 19 Mar 2019, balaji marisetti wrote:
> >
> >> Can anyone please tell me if there is way to see the command history
> >> of a local git repo?
> >
> > If you really are only interested in the *Git* commands, you will be able
> > to implement something on top of the Trace2 feature (which just made it
> > into `master` but not into any official Git version yet, so it will most
> > likely be available when Git v2.22.0 comes out).
> >
>
> Trace2 will let you see all of the git commands,
> the alias expansions, and any shell commands launched
> by git. If those shell commands also run git commands,
> they will be listed too.
>
> However, it can't tell you what was otherwise done within
> the shell script.
>
>
> > If you are instead interested in all shell commands in a local Git
> > worktree (you probably meant the worktree, not the repository, I assume),
> > then you might need to play some games with Bash aliases to override `cd`
> > and reroute the history by re-setting `HISTFILE` and then calling `history
> > -cr` or something similar.
> >
> >> If there isn't a way, why hasn't the command-history feature been
> >> implemented?
> >
> > Because Git is an open source project. This means that nobody is
> > responsible for fulfilling your wishes, except for you. And you can do it,
> > too, this project welcomes all high-quality contributions.
> >
> > Ciao,
> > Johannes
> >
-- 
:-)balaji
Previous: Jeff Hostetler
Message 5 of 5 in “git command history”
  1. balaji marisettiMar 19, 2019
  2. Junio C HamanoMar 20, 2019
  3. Johannes SchindelinMar 22, 2019
  4. Jeff HostetlerMar 22, 2019
  5. balaji marisettiMar 25, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.