Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a new file to a subdirectory of a repository using the bitbucket server web interface?

klausisbruch March 26, 2018

If I use the bitbucket web interface to add a new file to my repository, I am asked to enter a file name. What do I need to enter there? Or, where in the repo will this file be created?

In detail: on the web interface, I click on the button "source", then select branch, drill down in my repos subdirectory structure to the right subdirectory, and there I press the button "+ New File".
A new dialog opens asking me for a filename.

1) Do I still have to enter a subdirectory path, to get the new file created there, or is it really only the file name I have to enter here?

2) Is there any "decent" way of specifying the subdirectory for creating a new file in the bitbucket web interface?

 

PS: my workstation is W10, and accidentally when I experimented here, I entered the complete path I copied from windows explorer to the directory where I needed the new file (on my local clone), the file was created, but now if I click the commit, bitbucket comes up with an error message "Something went wrong while trying to serve your request. Try reloading the page". It seems it dies on the backslashes it itself put into the file name :-).

Thanks, Klaus

 

1 answer

1 accepted

1 vote
Answer accepted
Dick
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 26, 2018

Hi Klaus,

1) Do I still have to enter a subdirectory path, to get the new file created there, or is it really only the file name I have to enter here?

If you are already drilled down to the right subdirectory, you only need to enter the file name (e.g. File.txt).

2) Is there any "decent" way of specifying the subdirectory for creating a new file in the bitbucket web interface?

If the subdirectory does not exist yet, use forward slashes to indicate directories. Let's say you have a repository 'MyRepository', that you have cloned in C:\MyRepository.

For the file C:\MyRepository\Some\Directory\file.txt , you should enter: Some/Directory/File.txt as the filename.

It should look like this:

Screen Shot 2018-03-27 at 4.35.36 pm.png

 

PS: my workstation is W10, and accidentally when I experimented here, I entered the complete path I copied from windows explorer to the directory where I needed the new file (on my local clone), the file was created, but now if I click the commit, bitbucket comes up with an error message "Something went wrong while trying to serve your request. Try reloading the page". It seems it dies on the backslashes it itself put into the file name :-).

I could not reproduce this behaviour. I just added an example file to my repository. I copied the full path C:\windows\test folder\test.txt and used that as a filename, it was created without problems. I am on Mac OS, though.

Hope this has helped you out!

Cheers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events