git

Git With ssh on Windows

TonyW
In this exercise, we will try to setup git and use ssh to connect the repo. Download and install git Open Git bash window Generate the keys ssh-keygen # this will generate an private key (id_rsa) and public key (id_rsa.pub) Add the content of public key (id_rsa.pub) to git profile settings Run git clone git clone ssh://git@git_repo_url:7999/test.git

Sync Two Git Repositories

TonyW
Sometimes, we have a requirement which needs to sync one git repo to another location whenever there is a change in primary repo. Sync the repo from primary to secondary git clone --mirror https://primary_repo_url/primary.git cd primary.git git remote add --mirror=fetch secondary https://secondary_repo_url/secondary.git git fetch origin git push secondary --all git push secondary --tags Sync it automatically To achieve this, we can set up a Job in Jenkins or Teamcity to monitor if any commit in primary repo, and then run script below

Add make to Git Bash on Windows

TonyW
Recently I need to use make command which is not packaged with Git Windows by default, and come across this git hub page, which mentioned how to add few commands to Git Bash on windows, this is quite handy and solved my problem. make Go to ezwinports. Download make-4.1-2-without-guile-w32-bin.zip (get the version without guile). Extract zip. Copy the contents to your Git\mingw64\ merging the folders, but do NOT overwrite/replace any existing files.