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 默认提交的仓库名称
  • 相关阅读:
    [BZOJ1584][Usaco2009 Mar]Cleaning Up 打扫卫生
    CSS浮动
    Django by example -----1总结
    C#函数重载
    linux目录的特点
    Linux调优
    linux
    对齐方式
    19-10-25-G-悲伤
    19-10-24-H
  • 原文地址:https://www.cnblogs.com/Nyan-Workflow-FC/p/14454788.html
Copyright © 2011-2022 走看看