Recently, while attempting a git pull, I was confronted with the following error:
Peer's certificate issuer has been marked as not trusted by the user.
The operation worked on a browser on my dev machine, and closer inspection revealed that the cert used to serve the GitLab service was valid, but for some reason the remote CentOS Linux server couldn’t pull from the remote.
While migrating code between version control systems (in my case SourceGear Vault to Git using an open-source c# program called vault2git), it’s sometimes necessary to pre-populate the first commit in the target system.
This yields an empty commit (git commit -m "initial commit" --allow-empty) with a timestamp of today, which is chronologically out of order of the incoming change set migration.
After completing the migration, the second commit is actually the commit which I’d like to be the root.
It took me a while to figure this out, but thanks to Greg Hewgill on Stack Overflow, I was able to replace the first commit of my branch with the second commit (and subsequently update the SHA1 hashes of all child commits) using this command:
git filter-branch --parent-filter "sed 's/-p <the__root_commit>//'" HEAD