Your hint says that the "HTTPS private key has been forgotten in Git." This could mean several things, but **I suspect it means that the private key was added and deleted from Git history,** which in turn means _you can get it back._

# Trawling Git

## Quick peek

If the Git history is short, `git log --stat` and the pager might be enough. Run the command below, <kbd>Ctrl</kbd>+<kbd>D</kbd> until you find the right commit, and `git show` it.

```sh
git log --all --stat --oneline
```

In an assignment like this with mocked up Git history, that's probably all you need. If not, you can take a closer look:

## Deeper dive

#### Filtering for files
Since your `ps aux` output says `--key=/root//key.pem`, try hunting for it. This path filter will check all for it in all tracked folders:

```sh
git log --all -- ':**/key.pem'
```

#### Filtering for text changes
If you have some text in mind to look for in a delta, there are two ways to do so. For you, that might be `-----BEGIN` or `PRIVATE KEY`. This first command runs faster, but needs the count of match instances in the whole repository to change. This ignores refactors and moved files, but might also miss what you're looking for under unexpected circumstances.

```sh
git log --all --stat -i --pickaxe-regex -S'private key'
```

This next command takes two passes through the history, making it slower than the previous one, but it checks for the text in every commit.

```sh
git log --all --stat -i -G'private key'
```

#### Filtering for commit message

It's unlikely to help you here (but worth noting in general) that you can also search commit messages.

```sh
git log --all --stat -i --grep='key'
```

# Lesson

If you or someone on your team puts secret data into Git, you can't just `git rm` it away. Its content stays there in the history _forever._ You need to use a tool like `git filter-repo` or `git filter-branch` to get rid of it, and _everyone_ with a clone of the repo who has `fetch`ed it since the secret was introduced needs to fix theirs, too. This might mean throwing their repo away and cloning a fresh copy.