zoukankan      html  css  js  c++  java
  • git: 替换remote origin

    查看远程origin地址:

    git remote -v

    删除现有的origin地址 或 更新名称:

    git remote remove origin
    git remote rename origin 新名称

    添加新的origin地址(新建的代码托管地址):

    git remote add origin 远程地址

    pull远程代码:

    git branch --set-upstream-to=origin/<branch> master
    git pull origin master --allow-unrelated-histories

    正常提交本地代码到新origin地址

     有多个远程地址时,提交之后需要push多个仓库:

    git pull 默认仓库
    git pull 远程仓库名称 分支名称
    git add .
    git commit -m ""
    git push 默认仓库 
    git push 远程仓库名称 分支名称

     修改默认提交仓库

    git config --global user.name 你的英文名
    git config --global user.email 你的邮箱
    git config --global push.default simple current
    must be one of nothing, matching, simple, upstream or current
    git config branch.master.remote 默认提交的仓库名称
  • 相关阅读:
    poj 3026 Borg Maze
    poj2828 Buy Tickets
    poj3264 Balanced Lineup
    高精度运算
    poj1035 Spell checker
    poj2318 TOYS 点积叉积理解
    求两直线交点的一般做法
    C语言I博客作业05
    C语言I博客作业04
    C语言I博客作业07
  • 原文地址:https://www.cnblogs.com/Nyan-Workflow-FC/p/14454788.html
Copyright © 2011-2022 走看看