Upon a change of my server’s certificates, my git configuration required to be updated. Else, git pulls will fail with the following error message: SSL: certificate verification failed The fix itself is simple, first download a copy of the new X509 certificate and then update the sslCAinfo field in the .git/config file.
Category Archives: git
(GIT): Loose object is corrupted
The simple fix for corrupted loose objects e.g $ git pull error: object file .git/objects/db/d8b4d398dcca4507fc2ce2d2817b9a7ede38a4 is empty fatal: loose object dbd8b4d398dcca4507fc2ce2d2817b9a7ede38a4 (stored in .git/objects/db/d8b4d398dcca4507fc2ce2d2817b9a7ede38a4) is corrupt Solution: $ find .git/objects/ -size 0 -exec rm -f {} \; $ git pull
GIT: different types of add
# add to index only files created/modified # and not those deleted $ git add . # add to index only files deleted/modified # and not those created $ git add -u # do both operation at once, # add to index all files $ git add -A
GIT: revert last commit
To revert the last commit which hasn’t yet been pushed: git reset –soft HEAD~1 To unstage a file: git reset file
GIT: Creating a bare repo
Simple commands on how to create a bare repository mkdir gitproject.git cd gitproject.git git –bare init git update-server-info
GIT: Origin fixed
When origin is lost, no sync, it feels like one is lost in the sea. Luckily, no need to seek for a captain to prevent the ship from drowning. $ git config –get remote.origin.url $ git remote set-url origin file:///mypath Aye aye, Captain !