git 版本管理之可视化工具使用
2017-02-26 本文已影响469人
小Ju
终端的git大家应该会使用了,现在使用比较简单,方便的方法管理版本,直接使用SourceTree工具.
1.先创建远程创库
首先在github上创建new repository

填写创库名称

选取忽略文件

选取分享协议

然后按创建,这样就完成远程创库的创建

2.用SourceTree拉取到本地创库
先在桌面创建一个文件夹,然后在远程创库里获取url

在终端前往这个文件夹 cd + 文件夹路径,然后输入 git clone https://github.com/xiaojuye/text.git 打开文件夹就看到这样有一个.git的隐藏文件(如果看不见,可以先打开隐藏文件的设置)

然后就可以把你创建的工程文件放到text文件夹了,注意:在创建工程的时候不要勾选create Git repository了

打开SourceTree将刚刚的文件夹text拖到SourceTree中,注意:这个文件夹应该是.git文件的上一个文件

2.SourceTree的使用介绍
提交代码编辑框(可以用来标记改了什么内容,谁提交)

在SourceTree上面就直接有按钮可以推送,拉取等功能(不用写命令就是爽)

注意:如果你按推送的时候弹出要输入账号和密码就输入你的githut账号密码就行了