git Bitbucket:使用 Mac OSX 将本地构建的项目添加到 bitbucket
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17524671/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bitbucket: Adding a local built project to bitbucket using a Mac OSX
提问by Simon Davies
I have recently added a project as a git project (im new to git and learning) and i was looking at using Bitbucket via Source tree on a mac, but how do i add a locally created project to Bitbucket, as i am using Source Tree but it does not seem to push to my online account do i have to create a repository online first, then clone it then work form within there, or need to some more setting up in order for it to comunicate with Bitbucket
我最近添加了一个项目作为 git 项目(我是 git 和学习的新手),我正在考虑通过 mac 上的源树使用 Bitbucket,但是我如何将本地创建的项目添加到 Bitbucket,因为我正在使用源树但它似乎没有推送到我的在线帐户,我是否必须先在线创建一个存储库,然后克隆它然后在那里工作,或者需要进行更多设置才能与 Bitbucket 通信
采纳答案by Simon Davies
Thanks for anyone looking, i managed to trawl through some videos and found this: http://www.youtube.com/watch?v=Hs_Z99nOKM8
感谢任何人寻找,我设法浏览了一些视频并找到了这个:http: //www.youtube.com/watch?v=Hs_Z99nOKM8
回答by founddrama
You need to add the BitBucket repo as an upstream remote of your local repository.
您需要将 BitBucket 存储库添加为本地存储库的上游远程。
After you've created the repo on BitBucket (or Github or wherever...), copy the URL of the remote repository. It should looks something like [email protected]:your_username/your_repo_name.git
在 BitBucket(或 Github 或任何地方...)上创建存储库后,复制远程存储库的 URL。它应该看起来像[email protected]:your_username/your_repo_name.git
Then to add the repo as a remote from the command line:
然后从命令行添加 repo 作为远程:
git remote add origin [email protected]:your_username/your_repo_name.git
I'm not sure how you would do it in SourceTree, but if you search the application's help menu for adding a remote, I imagine it must have instructions.
我不确定您将如何在 SourceTree 中执行此操作,但是如果您搜索应用程序的帮助菜单以添加遥控器,我想它必须有说明。