如何使用sourcetree添加远程存储库

时间:2017-07-13 22:35:27

标签: git bitbucket atlassian-sourcetree

我使用的是Mac,而且我是bitbucket和sourcetree的新手。我想将我的本地存储库推送到远程存储库。所以在sourcetree中,我按下了#34; New","克隆来自Url"我从远程存储库中粘贴了url。当我按回车键时,它表示该网址无效。

我有点急于安装,所以也许就是这样。

2 个答案:

答案 0 :(得分:7)

我假设您的本地文件夹已使用git初始化。

有两种方法可以实现这一目标:

通过Sourcetree app:

  1. 在Sourcetree中,选中左侧窗格中的Remotes
  2. enter image description here

    1. 右键单击它并选择New Remote
    2. enter image description here

      1. 将链接插入您的仓库并单击确定

      2. 完成后,只需从您的分支机构执行拉动并将更改提交到仓库

      3. 通过终端(简单方法)

        1. cd /path/to/your/repo
        2. git remote add origin https://path_to_your_repo
        3. git push -u origin master

答案 1 :(得分:1)

Sahan说的是正确的。但解决了我的问题的是我必须在远程存储库中创建第一个文件夹。

相关问题