Я разделил один репозиторий SVN на несколько репозиториев, как описано в http://www.mugo.ca/Blog/Splitting-a-Subversion-repository-into-multiple-repositories. Однако я не могу выполнить последний шаг для перемещения существующих рабочих копий.
svn: E195009: 'svn+ssh://user@server/newrepo' is not the root of the repository.
Кто-нибудь знает, что не так?
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
<!— —>
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
atayardimci opened this issue
Aug 5, 2022
· 12 comments
Verify this by creating an alias in ~/.gitconfig
like so:
and you’ll find that, no matter where you call git pwd
from, it always prints
the repository root directory.
This is annoying for git diff --relative
aliases where it’s desirable to have
the printed filepaths relative to the current directory.
For example, until five minutes ago I had this alias for printing all files
touched in a pull request:
but this would print the path from the repository root, meaning you couldn’t
pipe the output to a command unless your current directory was the repository
root.
The solution is to use the $GIT_PREFIX
environment variable which contains the
directory where the alias was invoked. So my prfiles
alias is now:
Note, we define a default value of ./
as $GIT_PREFIX
isn’t set when the
alias is invoked from the repository root.
Now I can run things like:
to edit all files from my pull request that contain “foo”.
The $GIT_PREFIX
variable has been available since
v1.7.6).
It’s a little hard to find as it isn’t mentioned in the
current online docs on aliases
but is documented in the man pages (try man -K GIT_PREFIX
).
This has caught me up a couple times. I have a terminal open inside a GIT repository. I do git status
to see all the changes across the repository. I then do git add -A
, git commit -m "Some text"
and git push
to push everything to GitHub.
How can I git add
from within a GIT repository (not necessarily having the root directory as working directory) so that it will add all changes across the repository?
asked Feb 12, 2013 at 13:46
You can use git add -A :/
.
This appears to require git 1.7.6 or newer.
answered Feb 12, 2013 at 15:00
19 silver badges16 bronze badges
Since my other answer requires a newer version of git, here’s an alternative that will hopefully work with older versions.
Aliases where the expansion starts with an exclamation mark are treated as separate shell commands, and they are defined as executing in the top level of the repository. So you could define such an alias and use that in place of git add
:
git config --global alias.addroot '!git add'
git addroot -A
Or you could include the -A
option in the alias.
answered Feb 12, 2013 at 16:43
19 silver badges16 bronze badges
git commit -a -m commit_msg
will do what you want. Note that with this command, the -a
flag does the adding, so don’t do a separate git add
before the commit.
answered Feb 12, 2013 at 14:51
4 gold badges51 silver badges51 bronze badges
Spoiler alert: this is not as daunting as it sounds 🙌
So today, I decided to change the root folder of my GitHub repository from the parent folder I had initially initialised the repository in, to a child folder in the same directory.
I almost didn’t bother as I had flashbacks of past nightmare experiences changing things on git but I decided to give it a go and luckily it was much easier than I thought wooo!
I thought I would record this for my future benefit and yours.
- The process
- Now without further ado, here are the steps:
- Additional steps to add a merge message:
- Building and publishing your project
- Why does my project have status “failing”?
- Why does my project have status “passed” but I get a 404 page?
- Why do I get import errors from libraries depending on C modules?
- Where do I need to put my docs for RTD to find it?
- How can I avoid search results having a deprecated version of my docs?
- How do I change the version slug of my project?
- What commit of Read the Docs is in production?
- Additional features and configuration
- How do I add additional software dependencies for my documentation?
- Can I have access to additional features or settings?
- How do I change behavior when building with Read the Docs?
- Can I remove advertising from my documentation?
- How do I change my project slug (the URL your docs are served at)?
- Big projects
- How do I host multiple projects on one custom domain?
- How do I support multiple languages of documentation?
- Sphinx
- I want to use the Blue/Default Sphinx theme
- I want to use the Read the Docs theme locally
- Image scaling doesn’t work in my documentation
- Python
- Can I document a Python package that is not at the root of my repository?
- Does Read the Docs work well with “legible” docstrings?
- I need to install a package in a environment with pinned versions
- Can I use Anaconda Project and ?
- Other documentation frameworks
- How can I deploy Jupyter Book projects on Read the Docs?
- 2 ответы
- Comments
- Comments
The process
Essentially what you need to do is move the .git folder to the folder you want to be the root folder.
These are the steps I took in the command line (remember I am moving my .git one folder inwards — you will need to adjust the commands to your needs).
In the below example, $ represents a command line prompt which may look slightly different to yours.
Now without further ado, here are the steps:
Start by moving your .git file to the folder that you want to go to.
- $ mv .git
Then navigate to that folder.
- $ cd
Then add all the changes to the staging area. Git will detect these files as renamed versions of old files that were ‘lost’ and so no history will be lost.
- $ git add .
Commit all the changes with the -a command. The -a command stands for all. It tells the commit command to automatically stage files that have been modified and deleted whilst new files that you have not told Git about are not affected.
- $ git commit -a
- $ git push
Additional steps to add a merge message:
Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch
To solve this:
- Press “i”
- Write your merge message
- Press the “esc” key.
- Type “:wq”
- Then press enter
You will then to git push again and you’re done!
Version Used:
dotnet sdk 2.2.300
Steps to Reproduce:
- dotnet new console
- dotnet build /p:ContinuousIntegrationBuild=true
C:\Program Files\dotnet\sdk\2.2.300\Roslyn\Microsoft.Managed.Core.targets(102,5): error : SourceRoot items must include at least one top-level (not nested) item when DeterministicSourcePaths is true
Expected Behavior:
Build Succeeds.
The mere fact that we we are performing a continuous integration build does not mean that source control information will be available to MSBuild. However deterministic builds are enabled by default, and turning on ContinuousIntegrationBuild
, means that DeterministicSourcePaths
is enabled.
That would be fine if DeterministicSourcePaths
worked when no source control information was available, but it requires SourceRoot
items, which are only created by a source control information provider like the Source Link packages.
This bit me when I tried to add a new Test project to a solution being built with /p:ContinuousIntegrationBuild=true
. I did not bother to add a Source Link NuGet package since I was not going to package or publish the test project on the CI server, merely run it, so I don’t actually need Source Link data in the pdbs.
Obviously I know the workarounds (add the Source Link package or set DeterministicSourcePaths
to false in the test project).
But ideally they would not be needed. Instead ideally, either a) DeterministicSourcePaths
would only be set if a source control information provider package was installed, or b) that DeterministicSourcePaths
was somehow made to work even without a source provider package.
Building and publishing your project
Why does my project have status “failing”?
Projects have the status “failing” because something in the build process has failed.
This can be because the project is not correctly configured,
because the contents of the Git repository cannot be built,
or in the most rare cases because a system that Read the Docs connects to is not working.
First, you should check out the Builds tab of your project.
By clicking on the failing step,
you will be able to see details that can lead to resolutions to your build error.
If the solution is not self-evident,
you can use an important word or message from the error to search for a solution.
Why does my project have status “passed” but I get a 404 page?
This often happens because you don’t have an file being generated.
(MkDocs or Sphinx with MyST)
To test if your docs actually built correctly,
you can navigate to a specific page that you know is part of the documentation build,
for example .
Why do I get import errors from libraries depending on C modules?
Another use case for this is when you have a module with a C extension.
This happens because the build system does not have the dependencies for
building your project, such as C libraries needed by some Python packages (e.g.
or
). For libraries that cannot be installed via apt in the builder there is another way to
successfully build the documentation despite missing dependencies.
With Sphinx you can use the built-in autodoc_mock_imports for mocking. If
such libraries are installed via , you also will need to remove all
the C-dependent libraries from your in the RTD environment.
Where do I need to put my docs for RTD to find it?
Read the Docs will crawl your project looking for a . Where it finds the
,
it will run in that directory.
So as long as you only have one set of sphinx documentation in your project, it should Just Work.
You can specify an exact path to your documentation using a Read the Docs Using a configuration file.
How can I avoid search results having a deprecated version of my docs?
If readers search something related to your docs in Google, it will probably return the most relevant version of your documentation.
It may happen that this version is already deprecated and you want to stop Google indexing it as a result,
and start suggesting the latest (or newer) one.
To accomplish this, you can add a file to your documentation’s root so it ends up served at the root URL of your project
(for example, https://yourproject.readthedocs.io/robots.txt).
We have documented how to set this up in .
How do I change the version slug of my project?
What commit of Read the Docs is in production?
We deploy readthedocs.org from the branch in our GitHub repository.
You can see the latest commits that have been deployed by looking on GitHub: https://github.com/readthedocs/readthedocs.org/commits/rel
We also keep an up-to-date .
Additional features and configuration
How do I add additional software dependencies for my documentation?
For most Python dependencies,
you can can specify a requirements file which details your dependencies.
You can also set your project documentation to install your Python project itself as a dependency.
Can I have access to additional features or settings?
If this is just a dependency issue,
see How do I add additional software dependencies for my documentation?.
Reference of all Feature Flags that can be requested.
How do I change behavior when building with Read the Docs?
When RTD builds your project, it sets the environment
variable to the string . So within your Sphinx
file, you
can vary the behavior based on this. For example:
The variable is also available in the Sphinx build
environment, and will be set to when building on RTD:
Can I remove advertising from my documentation?
Yes. See Opting out of advertising.
How do I change my project slug (the URL your docs are served at)?
We don’t support allowing folks to change the slug for their project.
You can update the name which is shown on the site,
but not the actual URL that documentation is served.
The main reason for this is that all existing URLs to the content will break.
You can delete and re-create the project with the proper name to get a new slug,
but you really shouldn’t do this if you have existing inbound links,
as it breaks the internet.
Big projects
How do I host multiple projects on one custom domain?
For example,
Kombu is a subproject of Celery,
so you can access it on the domain:
This also works the same for custom domains:
For details on custom domains, see our documentation on .
How do I support multiple languages of documentation?
Read the Docs supports multiple languages.
See the section on Localization of documentation.
Sphinx
I want to use the Blue/Default Sphinx theme
We think that our theme is badass,
and better than the default for many reasons.
Some people don’t like change though 😄,
so there is a hack that will let you keep using the default theme.
If you set the variable in your
,
it should default to using the default theme.
The value of this doesn’t matter, and can be set to for default behavior.
I want to use the Read the Docs theme locally
Read the Docs automatically applies the sphinx-rtd-theme to projects that do not have a defined theme.
If you build a Sphinx project locally,
you should specify that you are using sphinx-rtd-theme.
Image scaling doesn’t work in my documentation
Image scaling in docutils depends on PIL. PIL is installed in the system that RTD runs on. However, if you are using the virtualenv building option, you will likely need to include PIL in your requirements for your project.
Python
Can I document a Python package that is not at the root of my repository?
Please note that the path must be relative to the working directory where is launched,
rather than the directory where the requirements file is located.
Therefore, even if you want to move the requirements file to a directory,
the example path above would work.
You can customize the path to your requirements file and any other installed dependency
using a Read the Docs Using a configuration file.
Does Read the Docs work well with “legible” docstrings?
Yes. One criticism of Sphinx is that its annotated docstrings are too
dense and difficult for humans to read. In response, many projects
have adopted customized docstring styles that are simultaneously
informative and legible. The
NumPy
and
Google
styles are two popular docstring formats. Fortunately, the default
Read the Docs theme handles both formats just fine, provided
your specifies an appropriate Sphinx extension that
knows how to convert your customized docstrings. Two such extensions
are numpydoc and
napoleon. Only
is able to handle both docstring formats. Its default
output more closely matches the format of standard Sphinx annotations,
and as a result, it tends to look a bit better with the default theme.
I need to install a package in a environment with pinned versions
To ensure proper installation of a Python package, the will automatically upgrade every dependency to its most recent version in case they aren’t:term:
by the package definition.
If instead you’d like to pin your dependencies outside the package, you can add this line to your requirements or environment file (if you are using Conda).
In your file:
# path to the directory containing setup.py relative to the project root
In your Conda environment file ():
# path to the directory containing setup.py relative to the environment file
Can I use Anaconda Project and
?
Yes. With you can use the Anaconda Project configuration
file (or
) directly in place of a
Conda environment file by using as an alias for
.
I.e., your file can be used as a
config
in the config file if it contains:
Other documentation frameworks
How can I deploy Jupyter Book projects on Read the Docs?
According to its own documentation,
Jupyter Book is an open source project for building beautiful,
publication-quality books and documents from computational material.
# Generate the Sphinx configuration for this Jupyter Book so it builds.
2 ответы
Вы пропустили одно примечание из использованного HowTo
Если вы измените путь, шаг 6 относительно команды «переместить» не будет работать, чтобы повторно указать существующие проверки репозитория. Вы должны были бы сделать отдельная касса а затем объединить любые различия.
Создан 18 фев.
Я столкнулся с этой проблемой при перемещении проекта в том же репо в другой каталог. Для этого вам понадобится «svn switch». Правило такое, от http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.relocate.html:
- Если рабочая копия должна отражать новый каталог в репозитории, используйте переключатель svn.
- Если рабочая копия по-прежнему отражает тот же каталог репозитория, но расположение самого репозитория изменилось, используйте svn relocate.
Создан 01 июн.
Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками
svn
or задайте свой вопрос.
Comments
jsaguet
added a commit
to jsaguet/nx
that referenced
this issue
Feb 20, 2020
Use file full path in git show to identify affected files to fix an issue when nx workspace is not at the root of git repository
nrwl#2292
jsaguet
added a commit
to jsaguet/nx
that referenced
this issue
Feb 22, 2020
Use file full path in git show to identify affected files to fix an issue when nx workspace is not at the root of git repository
nrwl#2292
This was referenced
Feb 22, 2020
jsaguet
added a commit
to jsaguet/nx
that referenced
this issue
Feb 23, 2020
Use file full path in git show to identify affected files to fix an issue when nx workspace is not at the root of git repository
nrwl#2292
jsaguet
added a commit
to jsaguet/nx
that referenced
this issue
Feb 23, 2020
Use file full path in git show to identify affected files to fix an issue when nx workspace is not at the root of git repository
nrwl#2292
jsaguet
added a commit
to jsaguet/nx
that referenced
this issue
Feb 23, 2020
Use file full path in git show to identify affected files to fix an issue when nx workspace is not at the root of git repository
nrwl#2292
jsaguet
added a commit
to jsaguet/nx
that referenced
this issue
Feb 23, 2020
Use file full path in git show to identify affected files to fix an issue when nx workspace is not at the root of git repository
nrwl#2292
jsaguet
added a commit
to jsaguet/nx
that referenced
this issue
Feb 23, 2020
Use file full path in git show to identify affected files to fix an issue when nx workspace is not at the root of git repository
nrwl#2292
FrozenPandaz
pushed a commit
that referenced
this issue
Feb 28, 2020
Use file full path in git show to identify affected files to fix an issue when nx workspace is not at the root of git repository
#2292
vsavkin
pushed a commit
that referenced
this issue
Mar 10, 2020
Use file full path in git show to identify affected files to fix an issue when nx workspace is not at the root of git repository
#2292
github-actions
locked as resolved and limited conversation to collaborators
Mar 25, 2023
Comments
Description:
Add an input to the action (working-directory
or project-directory
) to specify the path to the project, where the pyproject.toml
file is located. Use this directory to look for the pyproject.toml
and cached deps.
Justification:
Caching doesn’t work for projects where the project is not in the root of the repository.
with: python-version: 3.9 cache: poetry cache-dependency-path: foo/poetry.lock - run: poetry install with: path: /home/runner/.cache/pypoetry/virtualenvs key: hashFiles('foo/poetry.lock')
I hope this feature request be integrated into setup-python : )
I have a totally same issue because using monorepo. My root is not the root of the project.
Hello everyone!
We’ve released v4.5.0 action version. Could you please try using it and check that everything is working as expected and the issue is fixed?
I am closing the issue, since the new release should fix it.
Please let us know if you are still facing this issue.
Thanks!
Base on this PR #447