Merikan Blog

My personal braindump

How to Sign Git Commits

Installation To be able to sign our git commits on Macos we have to install gnupg and pinentry-mac. When installing gnupg a pinentry is provided but we want to use a pinentry that is specific för MacOS so we can use the Key-chain to store our Passphrase. First install gnupg, later on we will install pinentry-mac too. $ brew install gnupg Generate a key First we have to generate a key that we will use.

Move a git repository to another location.

Clone the the repository git clone https://code.google.com/p/my_repo cd my_repo List all local and remote branches. Note: All branches will be pushed later, both local and remote. git branch -a Track all remote branches. for remote in git branch -r | grep -v '\->'; do git branch –track ${remote#*/} $remote; done Add the new remote repository. git remote add new-origin git@github.com:user/my_repo.git git remote -v Push all branches to the new remote repository location.