Thursday, May 18, 2023

Logrotate

 

```

# cat /etc/logrotate.d/vault

/opt/vault/audit/audit.log {

    daily

    rotate 365

    compress

    missingok

    notifempty

    dateext

    dateformat %Y-%m-%d.

    create 0600 vault vault

    postrotate

        /bin/kill -HUP `cat /run/vault/vault.pid 2>/dev/null` 2> /dev/null || true

    endscript

}

```

Tuesday, May 2, 2023

Reference: 

https://stackoverflow.com/questions/11623862/fetch-in-git-doesnt-get-all-branches

Problem:

$ git checkout origin/INF-2308

error: pathspec 'origin/INF-2308' did not match any file(s) known to git

Solution: 

The problem can be seen when checking the remote.origin.fetch setting

(The lines starting with $ are bash prompts with the commands I typed. The other lines are the resulting output)

$ git config --get remote.origin.fetch
+refs/heads/master:refs/remotes/origin/master

As you can see, in my case, the remote was set to fetch the master branch specifically and only. I fixed it as per below, including the second command to check the results.

$ git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
$ git config --get remote.origin.fetch
+refs/heads/*:refs/remotes/origin/*
$ git checkout INF-2308