git

$ ssh-keygen -t rsa -C "youremail@example.com"
$ git config --global user.name "your name"
$ git config --global user.email "your_email@youremail.com"
 
git add <filename>
git add *
git init
c/user/尹/.ssh/id_rsa
 
已提交暂存区但还未提交远端仓库
命令:git commit --amend -m
 
git reset HEAD~6
 
将提交到暂存区的文件回撤
$ git commit --amend
git reset HEAD~4
 
 
git checkout -B master
git checkout -b master
 
 git merge --no-commit develop 

强制覆盖本地分支

git fetch --all git reset --hard origin/master
git pull
 

git常用命令 :
git init 创建仓库

git add XX 将代码添加到stage暂存区, 或手动解决代码冲突后标记解决

git commit -m '跟新说明' 提交 ,

git commit -a -m '跟新说明' 把所有已跟踪但未暂存的文件提交

git branch 查看分支

git branch test 创建test分支,  git checkout test 切换test分支,  git checkout -b test 前两句命令简写创建并且切换到test分支 

git branch -d test 删除分支

git merge test (合并分支主要步骤是1:先切换回主线分支2:然后再执行这条命令,将分支代码合并到主线分支上)

git status -s 文件详情 git diff 未暂存作了哪些修改 git diff --stage 暂存区作了哪些修改

原文地址:https://www.cnblogs.com/ywsheng/p/11250567.html