您的位置:首页 > 其它

win10安装Git步骤和常用的Git命令

2017-03-21 18:17 429 查看
 


win10安装Git步骤和常用的Git命令

先从Git官网,由于我的系统是64位的所以选择64-bit Git for
Windows Setup

(由于墙的原因,下载速度会很慢,建议直接CSDN下载搜索Git来下载

2.Git安装

直接一路next,安装完成以后在cmd中输入
git --version
查看是否正确安装好

3.Git配置

设置自己的昵称 
git config --global user.name "yourname"


设置自己的email 
git config --global user.name "youreamil"


CRLF配置 

由于之前出现过CRLF的报错,所以我在这里配置 
git config --global core.autocrlf true


愉快的开始Git之旅

自己常用的一些Git命令
显示command的help
git help <command>

将工作文件修改提交到本地暂存区
git add <file>

提交修改内容
git commit "message"

将本地主分支推到远程
git push -u <remoteName> <localBrachName>

克隆远程仓库
git clone <url>

初始化仓库
git init

创建仓库
git remote add <remoteName> <url>

删除远程仓库
git remote rm <name>

修改远程主机名
git remote rename <remoteName> <newRemoteName>

拉取远程仓库
git pull <remoteName> <localBrachName>

修改远程仓库
git remote set-url --push <remoteName> <newUrl>

获取远程仓库的更新
git fetch <remoteName>

获取远程仓库特定分支的更新
git fetch <remoteName> <brachName>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: