为Ubuntu中的现有文件创建一个新的BitBucket存储库

问题描述:

我有一些文件要添加到BitBucket上的新存储库中.如何使用Ubuntu的命令行执行此操作?

I have files that I want to add to a new repository on BitBucket. How can I do this using a command line from Ubuntu ?

一种替代方法是先从BitBucket网站创建存储库,但我不知道如何将存储库克隆到非空目录中.

An alternative would be to create the repository first from the BitBucket website but I don't know how to clone a repository into a non-empty directory.

有关在BitBucket上创建存储库时,会为您提供两个链接:

When you create a repo at BitBucket, you are offered two links:

  • 我从头开始"
  • 我有一个要推广的现有项目"

单击第二个,将为您提供在本地存储库中运行的命令.这些看起来像:

Click on the 2nd, and you will be given the commands to run in your local repo. These would look like:

> cd /path/to/my/repo
> git remote add origin https://me@bitbucket.org/me/test.git
> git push -u origin --all # pushes up the repo and its refs for the first time
> git push -u origin --tags # pushes up any tags