[Linux]本地模拟配置服务器端git仓库
2016-11-08 10:41
399 查看
在本地建立base ,gitA , gitB;
用base作为服务器端,gitA、gitB作为本地端从服务器中clone和push代码,本地验证是OK的。
以下是我总结的内容:
2、$
$ git config --global user.name "Your Name" //Your Name (是你的计算机名称)
$ git config --global user.email "youe@example.com"
//youe@example.com(计算机名称@localhost) 因为本地所以@+localhost才能在git clone时可以成功
3、$
当git init完成时 使用命令"la"就可以看到目录下存在一个.git文件夹
『重要』打开.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>啦
现在可以正常的git 操作了!!!
我这里配置是OK的,你们配置的是不是呢?
谢谢!
用base作为服务器端,gitA、gitB作为本地端从服务器中clone和push代码,本地验证是OK的。
以下是我总结的内容:
1、创建 base gitA gitB 三个目录
2、$
cd base
$ git config --global user.name "Your Name" //Your Name (是你的计算机名称)$ git config --global user.email "youe@example.com"
//youe@example.com(计算机名称@localhost) 因为本地所以@+localhost才能在git clone时可以成功
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的,你们配置的是不是呢?
谢谢!
相关文章推荐
- Linux和Git的配置,本地和远程仓库的操作
- 和菜鸟一起学linux之本地git中心仓库建立
- git的安装,配置和一个简单的本地仓库建立
- GIT使用入门——如何将本地工程在服务器新建仓库
- linux下配置本地yum源仓库
- 自己在本地搭建git版本仓库服务器
- 和菜鸟一起学linux之本地git中心仓库建立
- 和菜鸟一起学linux之本地git中心仓库建立
- Linux在本地建立git仓库管理代码
- linux上配置subversion服务器端安装配置并使用svn,windows本地检出,设置同步更新服务器的钩子
- 配置本地git链接远程仓库
- git 本地仓库和远程服务器仓库没有一样的提交,用git pull出错
- 1.git学习分享--新建本地仓库提交到服务器
- 和菜鸟一起学linux之本地git中心仓库建立
- linux系统管理之ip配置、yum本地仓库搭建、密码破解
- 和菜鸟一起学linux之本地git中心仓库建立
- 在Linux下使用gitosis配置安装Git服务器
- linux配置本地yum服务器
- git从linux远程服务器上下载源码到本地
- 超简单的同步本地git仓库到远端服务器