您的位置:首页 > 其它

Git一些操作总结

2018-04-19 17:39 78 查看
export GIT_EDITOR=vim




git status                    //(conflict查看冲突)
git add


git commit
git commit -amend




git checkout filename
git checkout branchname






git log
git log -p -1(number)
git log --follow filename
git log --stat




git show commit_id
git show branchname:filename




git diff                           //工作目录和索引之间的差异(conflict查看冲突)
git diff --cached commit_id        //索引和仓库中的差异
git diff commit_id1 commit_id2
git diff -S "search_string" branchname






git reset --hard/mixed/soft HEAD/ORIGIN_HEAD


git stash save
git stash pop


git cherry-pick branchname:commit_id      //从branchname指定的分支,拾取一些提交到当前分支




冲突处理:
git merge branchname 


git status
git diff


解决冲突未提交前:
git reset --hard HEAD
git checkout -m filename


提交后
git reset --hard ORIG_HEAD 阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: