Bitbucket / Mercurial / Tortoise How do I add a folder to the Bitbucket repository?

I am working on a project with two other people and want to create separate folders for each of us in the Bitbucket repository. I tried creating folders on my machine and pushing it to the repo, but that doesn't work.

Any suggestions?

+4
source share
1 answer

To create a folder, you need to create a file in this folder and add it to the repository, then you can click it. Mercurial tracks changes in files, so if there is no β€œcontent” in the folder, it will not be tracked.

Let's say you had a basic source file that you would like in each directory (we will call it main.cpp ), you can create such folders:

 $ mkdir folder1 $ mkdir folder2 $ hg st 

Please note that nothing is displayed in response to the status, as there are no new files.

 $ cp main.cpp folder1 $ cp main.cpp folder2 $ hg st ? folder1/main.cpp ? folder2/main.cpp 

The above shows that adding files to folders makes them β€œvisible” to Mercurial.

 $ hg add $ hg st + folder1/main.cpp + folder2/main.cpp 

Now the files are marked as added, and therefore, when you commit, they will exist in the repository.

Note that the above was an example to demonstrate that you need the files in a folder to view.

+6
source

All Articles