本博客是对git的笔记总结,只是简单的git用法 参考链接: 师兄带你15分钟入门GIT/GITHUB git的版本回溯(git想要退回到之前写过的某一个版本) Git 大全
第一步:下载git
https://git-scm.com/download/win 1.进入官网,选择相应版本进行下载  2.无脑下一步即可  3.点击鼠标右键就可以点击Git Bash Here打开git
第二步:配置Git
1.鼠标右键点击Git Bash Here 打开git 2.配置用户名和邮箱 用户名和邮箱可以自定义,这个是你提交到github和其它托管网站上的标识
git config --global user.email "你的邮箱"
git config --global user.name "你的用户名"

第三步:创建GitHub仓库
1.创建新的仓库  2.创建成功,记住HTTPS后面的URL 
第四步:将项目上传至GitHub
1.进入项目文件夹,鼠标右键点击Git Bash Here 打开git  2.输入命令
//在当前目录新建一个Git代码库
git init
//添加当前目录的所有文件到暂存区
git add .
//提交暂存区到仓库区
git commit -m “提交信息”
//增加一个新的远程仓库,并命名 (URL是刚刚保存的URL)
git remote add origin https://github.com/fightingzxd/Test.git
//上传本地指定分支到远程仓库
git push origin master
 3.查看github 
附加:多次提交项目
1.假设我写了sort.cpp如何提交  2.书写命令
//添加当前目录的所有文件到暂存区
git add .
//提交暂存区到仓库区
git commit -m “提交信息”
//上传本地指定分支到远程仓库
git push origin master
 3.查看github,这里可以看到sort.cpp已经提交到了github上 
附加:回溯到前面版本
1.使用命令
git log
git reset --hard [commit的编号]
注意:这个只是你本地仓库的变化,GitHub的仓库依然没有改变  
 
|