如何使用sourcetree添加远程存储库 [英] how to add remote repository using 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应用程序:
- 在Sourcetree中,检查左窗格中的
Remotes
- 右键单击它,然后选择
New Remote
-
将链接插入您的仓库,然后单击确定"
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
通过航站楼(简便方法)
-
cd /path/to/your/repo
-
git remote add origin https://remote_url_of_your_repo
-
git push -u origin master
cd /path/to/your/repo
git remote add origin https://remote_url_of_your_repo
git push -u origin master
这篇关于如何使用sourcetree添加远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!