This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ssh-keygen -t rsa # use git as key name | |
Generating public/private rsa key pair. | |
Enter file in which to save the key (/Users/xjiang/.ssh/id_rsa): git | |
Enter passphrase (empty for no passphrase): | |
Enter same passphrase again: ... | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put public key in authorized_keys at the server | |
# ~/.ssh/authorized_keys lists the public keys (RSA/DSA) that | |
# can be used for logging in as this user. | |
cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy private key to local machine | |
scp git@domain:~/path/to/privatekey/git_rsa ~/.ssh/ | |
# setup ssh config file to simplify future connection | |
vim ~/.ssh/config | |
# enter the following commands | |
# this will setup all configurations to connect to the git server | |
Host private_git_host | |
HostName yourdomain.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A bare repo is required everytime a new repo is created. | |
# It serves as the origin repo for remote users and is only updated by pushing to it. | |
cd ~ | |
mkdir test_repo | |
cd test_repo | |
git init --bare |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create local repo | |
mkdir test_repo | |
# add remote repo | |
# now you can see how private_git_host simplifies our life | |
git remote add origin private_git_host:test_repo.git | |
# we can push, pull, etc. | |
git touch test_file | |
git commit -m "test commit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create local repo | |
mkdir test_repo | |
# add remote repo | |
# now you can see how private_git_host simplifies our life | |
git remote add origin private_git_host:test_repo.git | |
# we can push, pull, etc. | |
git touch test_file | |
git commit -m "test commit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create local repo | |
mkdir test_repo | |
# add remote repo | |
# now you can see how private_git_host simplifies our life | |
git remote add origin private_git_host:test_repo.git | |
# we can push, pull, etc. | |
git touch test_file | |
git commit -m "test commit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create local repo | |
mkdir test_repo | |
# add remote repo | |
# now you can see how private_git_host simplifies our life | |
git remote add origin private_git_host:test_repo.git | |
# we can push, pull, etc. | |
git touch test_file | |
git commit -m "test commit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sudo chsh git -s $(which git-shell) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start from home directory | |
cd $HOME | |
# get Bazel dist from https://github.com/bazelbuild/bazel/releases | |
$ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip | |
# unzip Bazel | |
unzip bazel-0.4.5-dist.zip -d bazel | |
# compile Bazel |
OlderNewer