最近想做openstack的开发,需要用到git,看了proGit这本书,概念讲得很多,但缺乏一个相对实际操作的例子,准备结合书中原理,自己写一个相对简单的例子进行学习
安装:
redhat
yum -y install git git-core
ubuntu
sudo apt-get install git git-core
windows
安装图形化msysGit
初次运行前配置
/etc/gitconfig
系统中所有用户都普遍使用的配置
使用git config时用 --system 进行配置
~/.gitconfig
用户目录配置文件只试用于该用户
使用git config时用 --global 进行配置
[project]/.git/config
当前项目git目录的配置文件
git config默认使用
github注册
git config --global user.name "samplename"
git config --global user.email "samplename@163.com"
git hub create new project "git_test"
git clone "https://github.com/youzhibicheng/git_test.git"
cd git_test
vim readme.txt
git status
git commit -m "this is my first time commit to git"
git push
input the username and password of githun
got to website www.github.com, find your project, you will find the new added file "readme.txt"
git hub create new project "git_test"
git clone "https://github.com/youzhibicheng/git_test.git"
cd git_test
vim readme.txt
git status
git commit -m "this is my first time commit to git"
git push
input the username and password of githun
got to website www.github.com, find your project, you will find the new added file "readme.txt"