标签:
yum install git-core
?配置邮件和用户名,在提交代码的时候会展示。这个设置是全局设置。
[root@localhost ~]# git config --global user.name "lj"[root@localhost ~]# git config --global user.email "lj@test.com"
配置完成后,会在home下新建一个隐藏文件夹。
[root@localhost ~]# ls -la | find ~/.git*/root/.gitconfig
去掉global参数,即可设置当前用户对应的用户名和邮箱。
?我们可以通过ssh://,http(s)://,git://三种url来获取一个远程git仓库。
?获取git源码。
git clone git://git.kernel.org/pub/scm/git/git.git
?通过git init命令来初始化一个git仓库
[root@localhost ~]# mkdir code[root@localhost ~]# cd code[root@localhost code]# mkdir project_test[root@localhost code]# cd project_test/[root@localhost project_test]# touch t1.txt t2.txt[root@localhost project_test]# lst1.txt t2.txt[root@localhost project_test]# git initInitialized empty Git repository in /root/code/project_test/.git/
ls -la命令可以查看到对应的隐藏文件夹。
[root@localhost project_test]# ls -la总用量 12drwxr-xr-x. 3 root root 4096 8月 7 21:45 .drwxr-xr-x. 3 root root 4096 8月 7 21:44 ..drwxr-xr-x. 7 root root 4096 8月 7 21:45 .git-rw-r--r--. 1 root root 0 8月 7 21:45 t1.txt-rw-r--r--. 1 root root 0 8月 7 21:45 t2.txt[root@localhost project_test]#
版权声明:本文为博主原创文章,未经博主允许不得转载。如有问题,欢迎交流。
标签:
原文地址:http://blog.csdn.net/mergades/article/details/47357471