美文网首页
Git常用命令

Git常用命令

作者: 北方素素 | 来源:发表于2017-09-06 20:53 被阅读0次

    git常用命令:

    配置git用户:

    git config --global user.name '你的名字'

    git config --global user.email '你的邮箱'

    初始化repository:git init

    查看repository状态:git status

    向repository添加所有修改项:git add .

    提交修改:git commit -m "commit name"

    设置忽略项:写进.gitignore

    查看log:git log --oneline

    检出以前版本:git checkout 版本号

    回到master:git checkout master

    恢复到以前版本:git reset --hard 版本号

    关联github:git remote add origin https://github.com/xxx/xxx.git

    上传repository至GitHub:git push -u origin master

    一般使用步骤:

    在工作目录打开git bash

    初始化git

    查看git状态

    向repository添加文件

    设置commit

    相关文章

      网友评论

          本文标题:Git常用命令

          本文链接:https://www.haomeiwen.com/subject/dygvjxtx.html