Setup Git

http://www.tomdalling.com/blog/software-processes/how-to-set-up-a-secure-git-server-at-home-osx/

 

* /etc/ssh/sshd_config, must delete the comment tag "#"

touch .ssh/authorized_keys  //new file
open -a "TextEdit" .ssh/authorized_keys  //open with textedit

 

1)  Create an empty repository on the server side //initialize server git

$ cd path / to
$ mkdir newrepo.git
$ cd newrepo.git
$ git init --bare
# --bare flag is only used to store pushes, not as a local repository.

    2) On the client side, create a local repository and push //create local git and add to remote

$ cd path / to
$ mkdir newrepo
$ cd newrepo
$ git init
$ touch README
$ git add .
$ git commit -m "initial commit" 
$ git remote add origin git@yourComputerName:/path/to/newrepo.git # If the newrepo.git created directly on the server side is in the home directory, the address here is: git@ yourComputerName:newrepo.git
$ git push origin master

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326941126&siteId=291194637