mercurial hg clone turn off host key checking for

If you clone a repository during an automated code deploy (for example in AWS CodeDeploy or Atlassian Bamboo) then you probably need to turn off host key checking for the clone of your repository. This prevents hg (or git) from raising a user prompt about the authenticity of the host key.

$ echo -e "Host\nStrictHostKeyChecking no\n" >> ~/.ssh/config

git show commits between tags

Instead of making our developers use annotated tags, I just use the git log as a reference. This shows all the commits (minus the trivial ones) between a set number of tags back.

# tagsback=2; tagdiff=$(git tag | tail -$(($tagsback+1)) |tr '\n' ' '| awk '{print $1"..."$NF}'); echo -e "COMMITS BETWEEN $tagdiff\n"; git log --pretty=oneline $tagdiff | cut -d " " -f 2- | grep -v ^Merge
COMMITS BETWEEN 2014092401...2014102101

commit message 1
commit message 2
fixed some bug 
Refs #404885
some other message

connect to git host via ssh on non-standard port

Sometimes people run sshd on a non-standard port. It takes time to scan an IP block, and scanning each host for all 65,535 ports makes it take even longer. Most scanning scripts and utilities target common known open ports, like telnet, smb, and ssh. For this reason someone might opt to run sshd on a port other than 22. This is a problem if you are using git over ssh to connect to one of these repositories.

Add the follwing to your ssh config:

cat >>/home/<yourusername>/.ssh/config << EOF
Host <git server IP address>
  Port <obscure sshd port number>
  IdentityFile /home/<yourusername>/.ssh/id_git