安装 git 软件 nong@ls-wxl-e:~$ sudo ipkg install git Password: Package git (1.8.4.2-1) installed in root is up to date. Nothing to be done Successfully terminated. 由于我之前已经安装了,所以这次提示这样了。 进入用户 nong 的主目录配置 git 用户环境变量文件 PATH 。如果不设置好用户的 PATH ,运行 git 命令将提示"command not found"。cd /home/nong mkdir .ssh echo PATH=/mnt/disk1/.optware/bin:/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin >> .ssh/environment 更改 .ssh 目录及其中文件的 owner 为用户 nong chown -R nong.guoruei .ssh 更改 .ssh 目录的权限 chmod 700 .ssh chmod 600 .ssh/environment 然后去 disk 下建立文件夹,比如 /mnt/disk2 下面建立一个文件夹 gits 存放所有的 git 项目 mkdir /mnt/disk2/repo/gits 进入 cd /mnt/disk2/repo/gits 创建测试项目的目录 mkdir testpj.git 进入测试项目目录 cd testpj.git 初始化 git 仓库 nong@ls-wxl-e:/mnt/disk2/repo/gits/testpj.git$ git init --bare Initialized empty Git repository in /mnt/disk2/repo/gits/testpj.git/ 察看一下文件 nong@ls-wxl-e:/mnt/disk2/repo/gits/testpj.git$ ls HEAD branches config description hooks info objects refs 现在到客户端上。先安装 git 程序 nong@desktop:~$ sudo apt-get install git -y 然后把项目克隆下来 nong@desktop:~$ git clone nong@192.168.1.11:/mnt/disk2/repo/gits/testpj.git 会提示你输入你的服务器用户 nong 的密码。输入。 Cloning into 'testpj'... nong@192.168.1.11's password: warning: You appear to have cloned an empty repository. 使用 ls 命令,你会发现项目已经在本地了。至于怎么修改怎么创建新项目提交上去,去找本 git 书看看。就懂了。 |