zoukankan      html  css  js  c++  java
  • 创建本地Git并提交到码云

    概述

    安装Git,使用Git Bash创建本地Git全局用户名,提交远程代码时将以此用户名显示
    git config --global --replace-all user.email "itoracle@aliyun.com"
    git config --global --replace-all user.name "itoracle"

    在码云上创建一个git:https://gitee.com/itdb/all.git

    进入D盘
    cd /d
    下载远程git到本地
    git clone https://gitee.com/itdb/all.git
    #在本地添加一个远程git配置all,以后all就代表了远程的 https://gitee.com/itdb/all.git; 本地可以配置多个远程git,那么就需要为不同的远程git起个名字。
    git remote add all https://gitee.com/itdb/all.git

    配置SSH
    cd /c/Users/thinkpad
    ssh-keygen -t rsa -C "itoracle@aliyun.com"
    cd .ssh
    cat id_rsa.pub
    $ cat id_rsa.pub
    ssh-rsa AAAAB3……n.com
    将本地公钥复制到以下地方
    设置-->安全设置-->SSH公钥

    复制文件到git目录并上传到远程git,首次提交需要加-u
    cp -r /e/all/fxzonghe_cmd /d/all

    cd /d/all
    git add .
    git status
    git commit -m "ppcore first commit"
    将本地git推送到远程all的master分支
    git push -u all master


    第二次提交,没有使用-u参数
    cd /d/all
    git add .
    git status
    git commit -m "all second commit"
    git push all master

    git常用操作

    从远程拉取文件到本地

    git clone https://…….git

     拉取
    拉取远程服务器notebook的master分支
    git pull notebook master

    提交
    git add  .
    git commit -m "2019.11.20"
    git push  notebook master

    遇到错误

    remote: GitLab: You are not allowed to push code to protected branches on this project.

    这是提交者的权限不够,开发者角色不行,需要提升为管理员角色

  • 相关阅读:
    关于MIME类型问题,浏览器请求到的资源是乱码
    关于vue切换用户,路由表不更新问题
    Flutter环境安装,ios真机调试
    vue使用trackingjs
    js的中文英文排序
    google无法播放mp4 chrome无法播放h264
    写在Blog前
    NOI2010Day1
    菜鸡KLC的中考游记
    ABC161 题解
  • 原文地址:https://www.cnblogs.com/perfei/p/10302646.html
Copyright © 2011-2022 走看看