天天看点

Git使用基础

<a target="_blank" href="http://git-scm.com/download/">http://git-scm.com/download/</a>

<a target="_blank" href="http://git-scm.com/downloads/guis">http://git-scm.com/downloads/guis</a>

<a target="_blank" href="http://www.eclipse.org/egit/">http://www.eclipse.org/egit/</a>

配置用户名及邮箱

创建本地版本库

1.为~\myrep目录创建版本库,在该目录下会创建一个隐藏的版本库文件夹。 

2.在版本库中创建默认主分支 master。 

3.将当前的工作目录指针head指向master分支。

分支操作

提交修改到版本库

需要提交的文件修改通通先通过add命令放到暂存区,然后通过commit命令一次性提交暂存区的所有修改。

查看当前版本库文件修改状态

比较 版本库中文件 和 工作区的文件

日志

回退

撤销

从版本库中删除文件。

工作区操作

git 远程库地址有3种形式

<a target="_blank" href="https://github.com/xixihe/hello-world.git">https://github.com/xixihe/hello-world.git</a>

[email protected]:xixihe/hello-world.git

<a target="_blank" href="https://github.com/xixihe/hello-world">https://github.com/xixihe/hello-world</a>

远程库操作

<a target="_blank" href="http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000">git简易教程</a>

继续阅读