git常用命令总结:

git默认账户密码:        

        git config --global credential.helper store    之后输入一次账号密码即可

清除git用户名密码:

        git  config --system --unset credential.helper

拉错分支:

        git  fetch  origin  分支名字     
        git  reset  --hard  origin/分支名字

创建新分支并推送到远程仓库:

        git pull origin master
        git checkout  -b   新分支
        git add .     // 暂存到工作区
        git commit -m 'create new branch '    //提交到工作区
        git push origin  新分支
    git branch -a

修改远程仓库地址:

    1先查看当前远程仓库地址

        git remote –v

    2删除当前远程地址

        git remote rm origin

    3替换成新的仓库地址,把第一张图地址中的IP换一下

        git remote add origin [email protected]:/a.git

        git remote add origin [email protected]:/a.git

冲突处理:

        git merge --abort     //回到解决冲突之前的状态

暂存:

        git stash

        git stash pop
        git stash apply

clone代码时去除https验证:

        git config --global http.sslVerify false

刪除分支:

        git branch -D 分支名    删除本地分支

        git push origin --delete  分支名   删除远程分支

取消提交:

        git reset --hard

git commit 规范:

        feat:新功能(feature)   包含了描述与正文内破坏性变更的提交说明
        fix:修补bug    为fix编写的提交说明,包含可选的issue编号
        docs:文档(documentation)   不包含正文的提交说明
        style: 格式(不影响代码运行的变动)
        refactor:重构(即不是新增功能,也不是修改bug的代码变动)
        test:增加测试
        chore:构建过程或辅助工具的变动

git cz:

        git cz 替代 git commit(npm)

git flow:

        客户端工具:smart git

你可能感兴趣的:(git常用命令总结:)