• git命令使用步骤


    先安装git.exe 安装的时候不要改路径
    然后cd到C:Program FilesGitusrin目录
    ssh -t ras -C "xxx@xxx.com"
    创建仓库 输入项目名称 取消勾选 "使用Readme文件初始化这个仓库"

    打开本地cmd 切换到项目目录 输入如下命令
    查看本地仓库的状态
    git status
    将本地文件添加到暂存区
    git add .
    提交本地的文件到仓库
    git commit -m project

    设置你的git名称和电子邮箱
    git config --global user.name "dotcoo"
    git config --global user.email "dotcoo@163.com"

    添加本地仓库的远程地址
    git remote add origin https://gitee.com/dotcoo/vue-shop-01.git
    将本地的代码上传到远程仓库
    git push -u origin master


    查看当前状态 工作区是否干净
    git status

    如果是干净的 就操作之后的命令
    如果不是干净的
    git add .
    git commit -m xxx

    检出代码 创建一个新分支 叫做login
    git checkout -b login
    查看当前是哪个分支 login是绿色的
    git branch

    当前实在login分支中

    查看当前分支的状态
    git status
    将今天的代码添加到暂存区中
    git add .
    提交到本地
    git commit -m "完成了登录功能"

    切换到主分支
    git checkout master
    查看分支
    git branch 默认选中了master分支(绿色)
    login分支合并到主分支
    git merge login
    提交到码云中
    git push

    切换到login分支
    git checkout login
    查看分支
    git branch 默认选中了login分支(绿色)
    提交到
    git push -u origin login

    删除远程仓库地址

    git remote rm origin

  • 相关阅读:
    Ubuntu之修改用户名和主机名
    HM中CU,TU的划分
    BZOJ 3237([Ahoi2013]连通图-cdq图重构-连通性缩点)
    Introducing Regular Expressions 学习笔记
    kubuntu添加windows字体
    WISE安装程序增加注册控制
    Linux内核中常见内存分配函数(一)
    Linux内核中常见内存分配函数(二)
    Swift现实
    Android 5.0(L) ToolBar(替代ActionBar) 现实(四)
  • 原文地址:https://www.cnblogs.com/yangxiaobai123/p/11833877.html
Copyright © 2020-2023  润新知