git push / clone到新服务器 [英] git push/clone to new server

查看:98
本文介绍了git push / clone到新服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是在学习git,有些东西我不能解决。在Mac上本地创建并使用git存储库之后,我可以将副本推送到别处的另一台服务器上吗?我在防火墙后面,所以不幸的是我不能在另一台机器上运行 git clone

解决方案
  • git push name 分支

  • $ b

    示例:

      git remote add origin git@github.com:foo / bar .git 
    git push origin master

    查看 git的文档推送 - 您可以将遥控器设置为给定分支的默认遥控器;如果你不这样做,名字 origin 是特殊的。只需 git push 就可以完成和 git push origin thisbranch 你在)。


    Im just learning git and there is something I cant work out. After creating and using a git repository locally on my Mac, can I push a copy to another server somewhere else? I am behind a firewall so unfortunately I can't run git clone from the other machine.

    解决方案

    1. git remote add name url
    2. git push name branch

    Example:

    git remote add origin git@github.com:foo/bar.git
    git push origin master
    

    See the docs for git push -- you can set a remote as the default remote for a given branch; if you don't, the name origin is special. Just git push alone will do the same as git push origin thisbranch (for whatever branch you're on).

    这篇关于git push / clone到新服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆