git

如何忽略一些git commit

git stash

git rebase

git pull

git push

git init 将当前目录设置为git仓库

git add file1 file2(或者-A,详细看git add -h)将文件加入暂存区

git commit -m ".." 提交暂存区内容到本地版本库分支

git status

git diff file1 查看文件不同??????

git log --pretty=oneline查看提交日志

HEAD指向当前分支当前版本

HEAD^指向上一版本

HEAD~100上100个版本

git reset --hard  版本号/HEAD

git reflog 历史日志

master分支

git checkout????

做修改后,还没提交,可以用git checkout -- file 让文件回到最近一次git commitgit add时的状态。

git reset命令既可以回退版本,也可以把暂存区的修改回退到工作区。git reset HEAD。 接着再git checkout --  file/.

git remove file 并且 git commit -m ..

git branch 查看所有分支

git branch  name 创建分支

git checkout name 切换分支

git checkout -b name 创建并切换分支

git merge branchName 合并分支到当前分支

git branch -d  branchName 删除分支

合并分支有冲突时,解决冲突后直接提交就ok?

git merge --no-ff -m "merge with no-ff" dev
 git log --graph --pretty=oneline --abbrev-commit

git checkout .迁出当前分支上的当前目录所有文件
rm

git diff
git diff -cached
git diff HEAD
git diff branch1 branch2 directory

 

原文地址:https://www.cnblogs.com/miaolq/p/5778353.html