在服务器上:
$ cd /path/to/directory/
$ git init
$ git add .
$ git commit -m 'Initial commit'
Run Code Online (Sandbox Code Playgroud)
这将设置基本存储库并将所有文件添加/path/to/directory到其中。
在笔记本电脑上:
$ git clone username@server:/path/to/directory/
Run Code Online (Sandbox Code Playgroud)
git 将通过 ssh 连接以检索和克隆 repo。
此时,您可以进行更改、提交并执行git push,它将通过 ssh 将新提交推送到存储库。
由于您已经描述了一个只有您自己而不是其他人的简单设置,因此通过 ssh 工作应该没问题。您不需要设置 git 守护进程。
这里有更多信息:
http://fclose.com/b/linux/366/set-up-git-server-through-ssh-connection/
实际上,如果您环顾四周,应该有很多 git 教程。
| 归档时间: |
|
| 查看次数: |
1663 次 |
| 最近记录: |