在本地建立base ,gitA , gitB;
用base作为服务器端,gitA、gitB作为本地端从服务器中clone和push代码,本地验证是OK的。
以下是我总结的内容:
用base作为服务器端,gitA、gitB作为本地端从服务器中clone和push代码,本地验证是OK的。
以下是我总结的内容:
1、创建 base gitA gitB 三个目录
2、$ cd base
$ git config --global user.email "youe@example.com"
//youe@example.com(计算机名称@localhost) 因为本地所以@+localhost才能在git clone时可以成功
『重要』打开.git/config 添加一下内容
[receive]
denyCurrentBranch = false
下面几步还要注意一下
git status .
git add .
git commit -m "new file"
$ git clone archer@localhost:~/LIU_workspace/base
Cloning into 'base'...
archer@localhost's password:[我的密码]
如果要区分gitA 和base里的提交人需要在
gitA/base$ git config user.name = "A"
gitA/base$ git config user.email = "A@A.com"
这样你在gitA/base$提交代码Author就是:A<A@A.com>啦
3、$ git init
当git init完成时 使用命令"la"就可以看到目录下存在一个.git文件夹『重要』打开.git/config 添加一下内容
[receive]
denyCurrentBranch = false
下面几步还要注意一下
4、在base目录下
touch A.txtgit status .
git add .
git commit -m "new file"
5、现在gitA目录下
$ git clone archer@localhost:~/AAAAAA/L100 //"~/AAAAAA/L100"是我的服务器段$ git clone archer@localhost:~/LIU_workspace/base
Cloning into 'base'...
archer@localhost's password:[我的密码]
如果要区分gitA 和base里的提交人需要在
gitA/base$ git config user.name = "A"
gitA/base$ git config user.email = "A@A.com"
这样你在gitA/base$提交代码Author就是:A<A@A.com>啦
现在可以正常的git 操作了!!!
我这里配置是OK的,你们配置的是不是呢?
谢谢!