用GIT做版本控制-并上传至github

# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel

之后在git官网下载最新的版本源代码:

然后编译并安装:

# tar -zxvf git-1.8.4.2.tar.gz# cd git-1.8.4.2# make prefix=/usr/local all# make prefix=/usr/local install

初次运行git前的配置

用户信息:

第一个要配置你个人的用户名和电子邮件地址,每次提交时都会引用这两条信息

# git config –global user.name “Leon Hao”# git config –global user.email haolulue@163.com

# git config –global core.editor emacs

[root@SK-UAT-MYSQL /]# git config –listuser.name=Leon Haouser.email=haolulue@163.com

# See for more about ignoring files.## If you find yourself ignoring temporary files generated by your text editor# or operating system, you probably want to add a global ignore instead:# git config –global core.excludesfile ‘~/.gitignore_global’# Ignore bundler config./.bundle# Ignore the default SQLite database./db/*.sqlite3/db/*.sqlite3-journal# Ignore all logfiles and tempfiles./log/*.log/tmp

我们再加入一些规则,修改这个文件即可:(为了筛选出配合ruby使用,自己可以根据自己需要修改)

# See for more about ignoring files.## If you find yourself ignoring temporary files generated by your text editor# or operating system, you probably want to add a global ignore instead:# git config –global core.excludesfile ‘~/.gitignore_global’# Ignore bundler config./.bundle# Ignore the default SQLite database./db/*.sqlite3/db/*.sqlite3-journal# Ignore all logfiles and tempfiles./log/*.log/tmp# Ignore other unneeded files.doc/*.swp*~.project.DS_Store.idea

# git add .

# git commit -m “add README.MD”

# git checkout -f

# git checkout -b testfz

官方说明:

# cd ~/.ssh/# ssh-keygen -t rsa -C “haolulue@163.com”

# git remote add origin git@github.com:haoxiaolu/doccenter# git fetch# git commit -a -m “add file”# git add .# git push

,绊脚石乃是进身之阶。

用GIT做版本控制-并上传至github

相关文章:

你感兴趣的文章:

标签云: