git 如何在 BitBucket 上创建文件夹?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34066733/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 03:44:01  来源:igfitidea点击:

how to create folder on BitBucket?

gitbitbucket

提问by mikmik

How can I create a folder on BitBucket(web interface) to organize my repositories hierarchically?

如何在BitBucket(Web 界面)上创建文件夹以分层组织我的存储库?

Example :

例子 :

https://bitbucket.org/my_account/my_folder/my_repository

采纳答案by Jay Geeth

BitBucket does not provide you with such a feature to add an folder and manage your repositories inside a folder. Once you are in an account you can keep adding repositories, but you cannot manage repositories inside your account in folders.

BitBucket 没有为您提供添加文件夹和管理文件夹内存储库的功能。进入帐户后,您可以继续添加存储库,但无法在文件夹中管理帐户内的存储库。

回答by Ranga

Figured it out,

弄清楚了,

Open Repo >> Goto Source >> + New File >> Under fileName:

打开 Repo >> Goto Source >> + New File >> 在文件名下:

folder1/folder2/file.extension

folder1/folder2/file.extension

回答by Arowolo Daniel

Go to source and click Add Filethen at the filename, firstly write the folder name slash][ / ] the file name.

转到源并单击添加文件,然后在文件名处,首先写入文件夹名称斜杠][ / ] 文件名。

eg folder/file.php

this'll automatically create a new folder if not existing which would be name as folder and the file.php would be inside the folder.

如果不存在,这将自动创建一个新文件夹,该文件夹将命名为文件夹,file.php 将位于该文件夹内。

Goto Source >> + New File >> Under fileName:

folder1/folder2/file.extension

回答by JaakL

Bitbucket has now Projects feature which enables to organize repositories hierarchically just as you describe. The URL does not reveal project, but in web you see them.

Bitbucket 现在具有 Projects 功能,可以按照您的描述分层组织存储库。URL 不会显示项目,但在网络中您可以看到它们。

回答by Nick Snyder

I understand this is a bit of an old question but I would like to point out that Geeth W is actually wrong. You can in fact create folders in bitbucket, but the way that I've found to do it is via SourceTree.

我知道这是一个老问题,但我想指出 Geeth W 实际上是错误的。您实际上可以在 bitbucket 中创建文件夹,但我发现这样做的方法是通过 SourceTree。

  1. Create your new branch
  2. When specifying your new branch's name give it a folder prefixing the name, e.g. : backups/
  1. 创建你的新分支
  2. 指定新分支的名称时,给它一个文件夹作为名称前缀,例如:backups/

When you finalize the branch creation you'll see in the UI that it is in a folder, and in the web panel you'll also see that it is a member of that folder.

完成分支创建后,您将在 UI 中看到它位于文件夹中,并且在 Web 面板中,您还将看到它是该文件夹的成员。

Hope this helps.

希望这可以帮助。

回答by Arowolo Daniel

go to source and click Add File then at the file name, firstly write the folder name slash the file name.

转到源并单击添加文件,然后在文件名处,首先将文件夹名称写入文件名。

eg folder/file.php

例如文件夹/file.php

this will automatically create a new folder if not existing which would be name as folder and the file.php would be inside the folder.

如果不存在,这将自动创建一个新文件夹,该文件夹将命名为文件夹,file.php 将位于该文件夹内。

回答by Marcelo Finki

Using Command Line Interface git on Windows:

在 Windows 上使用命令行界面 git:

:: clone the repository to local computer

:: create the folder locally
> md {foldername}
> cd {foldername}

:: create local file(s)
> notepad file1.txt   :o) or similar

:: move one folder up 
> cd ..

:: check status
> dir {FolderName}
> git status

:: add your newly created files, 
:: Note the name of the FOLDER prefixing the file name!    
> git add {foldername}\file1.txt

:: check status
> git status

> git commit -m "created {foldername} etc etc"
> git push

:: check status
> git status

回答by icey

You can link VScode to your repo and add folders there:

您可以将 VScode 链接到您的存储库并在那里添加文件夹:

enter image description here

在此处输入图片说明

So bitbucket looks like...

所以bitbucket看起来像......

enter image description here

在此处输入图片说明