Rename a Git tag

Create a new tag alias :

git tag new_tag old_tag

Delete the old tag :

git tag -d old_tag

Push the changes :

git push –delete origin old_tag

git push origin :refs/tags/old_tag

Remove the local tags :

git pull –prune –tags

That’s all 🙂

Advertisements

Rsync without password to remote server with non-default SSH port

This is the normal rsync command, assuming your are using port 2222 for the SSH port :

rsync -avz -e “ssh -p 2222” /local_folder user@xx.xx.xx.xx:/remote_folder

However, this will require you to fill in the password. If the remote server is trusted, just create the key pair.

ssh-keygen

Enter file in which to save the key (/user/.ssh/id_rsa): put_any_name_here
Enter passphrase (empty for no passphrase):  (just press enter)
Enter same passphrase again: (just press enter)
Your identification has been saved in put_any_name_here
Your public key has been saved in put_any_name_here.pub.

Copy the key to remote server :

ssh-copy-id -p 2424 -i /user/.ssh/put_any_name_here.pub xx.xx.xx.xx

The key is now copied and you may log in to the remote server without using password anymore

ssh -p 2222 139.162.42.249

Schedule the rsync in a cronjob, that’s all 🙂