git基本操作

简介: 第一步创建一个drag库2:下载到本地管理   git clone [url]3:设置贡献者   git config --global user.name    //设置用户名字   git config --global user.

第一步创建一个drag库
2:下载到本地管理
  git clone [url]
3:设置贡献者
  git config --global user.name    //设置用户名字
  git config --global user.email    //设置用户邮箱
  git config --list              //查看所有的配置
Git命令
  git status   //查看状态
  git add    //添加到暂存区
  name      //
  .        //所有
  git commit //添加到版本区
  -m //简写
  -a -m //简写
对比
  git diff
  git diff --cached(--staged)
  git diff master
撤销
  git reset HEAD <file.name>
  git checkout -- <file.name>
  git commit --amend
删除
  git rm <file.name>
  git rm -f <file.name>
  git rm --cached <file.name>
恢复
  git checkout commit_id <file.name>
  git reset --hard commit_id
  HEAD^
  HEAD~<num>
  git reflog
同步到远程仓库
  git remote //查看远程仓库名字
  -v //
  origin //系统默认远程仓库名字
  git push origin master //同步到远程服务器

目录
相关文章
|
4月前
|
Linux 开发工具 git
【Git】Git基本操作-1
【Git】Git基本操作-1
|
11月前
|
缓存 开发工具 git
开心档之Git基本操作
开心档之Git基本操作
38 0
|
4月前
|
存储 开发工具 git
Git的基本操作和原理
Git的基本操作和原理
|
4月前
|
开发工具 git
Idea中Terminal中git基本操作
Idea中Terminal中git基本操作
104 0
|
4月前
|
存储 开发工具 git
Git的基本操作和原理
Git的基本操作和原理
37 4
|
4月前
|
存储 Unix 开发工具
【Git】Git基本操作-2
【Git】Git基本操作-2
|
4月前
|
存储 开发工具 git
git基本操作(配图超详细讲解)(二)
git基本操作(配图超详细讲解)(二)
36 0
|
4月前
|
算法 安全 开发工具
git基本操作(配图超详细讲解)(一)
git基本操作(配图超详细讲解)
53 0
|
11月前
|
存储 Linux 开发工具
Git:Git的一些基本操作
Git:Git的一些基本操作