如何使用sourcetree添加远程存储库 [英] how to add remote repository using sourcetree

查看:595
本文介绍了如何使用sourcetree添加远程存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Mac,并且是Bitbucket和Sourcetree的新手.我想将本地存储库推送到远程存储库.因此,在sourcetree中,我按了新建",从URL克隆",然后直接从我们的远程存储库粘贴了url.当我按Enter键时,该网址无效.

I'm using a Mac and I'm new to bitbucket and sourcetree. I want to push my local repository to a remote repository. So in sourcetree, I pressed "New", "clone from Url" and I pasted the url right from our remote repository. When I press enter, it says the url isn't valid.

我有点匆忙完成安装,也许就是这样.

I kinda rushed through the installation, so maybe that could be it.

推荐答案

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

I'm assuming your local folder is initialized with git.

有两种方法可以实现此目的:

There are two ways you can achieve this:

通过Sourcetree应用程序:

  1. 在Sourcetree中,检查左窗格中的Remotes

  1. 右键单击它,然后选择New Remote

  1. 将链接插入您的仓库,然后单击确定"

  1. Insert the link to your repo and click on OK

完成后,只需从分支执行一次Pull并将更改提交到仓库

Once that's done, just do a Pull from your branch and commit your changes to the repo

通过航站楼(简便方法)

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

这篇关于如何使用sourcetree添加远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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