-
Notifications
You must be signed in to change notification settings - Fork 178
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
Need help working with submodules #501
Comments
Have you verified if that You can check with this: and make sure you have initialized your submodules. |
The output of Currently I am running the following commands in a script to create and add the submodule through git SUBMODULE_DIR="./.secrets"
echo "# $SUBMODULE_NAME" >> $SUBMODULE_NAME/README.md
git -C $SUBMODULE_DIR init
git -C $SUBMODULE_DIR add README.md
git -C $SUBMODULE_DIR commit -m "feat: initial commit"
git -C $SUBMODULE_DIR branch -M $BRANCH_NAME
git -C $SUBMODULE_DIR remote add origin $REMOTE_URL
git -C $SUBMODULE_DIR push -u origin $BRANCH_NAME
# Remove newly created repository to make room for submodule
rm -rf "$SUBMODULE_DIR"
git submodule add $REMOTE_URL Would I need to run some of these commands through yadm or do I need to run |
I tried running the command I had just posted and got the error message I will look into what command or function is throwing that error. |
Looking at #414, would I need to run |
This generally happens when Git operations are being attempted in a context where the working directory is not properly set.
I think this should properly initialize your submodule, configure yadm, and run the status command without errors.
1.Ensure you have the necessary permissions to execute these commands and that your environment variables are correctly set. If errors persist, check |
This question is about
Folder structure
Describe your question
I am working on creating a repository to store tools which I can use alongside yadm to trivialize the process of using submodules and some of the other features integrated with yadm. When testing my configuration with a configured
yadm status
command I getNo such file or directory
errors.I add my utility repo as a submodule in any other project repository (
./dotfile-utils/
in the above folder structure) and then with some of the included scripts, install yadm and add another submodule to store dotfiles in for the parent project. Once the dotfiles submodule has been added at./.secrets/
I have not been able to configure the yadm command to properly run without error messages in the console on the submodule in./.secrets
.At this point I am trying to run the
yadm status
command as configured below with my terminal session located at the base of the project repository:This will correctly run
git status
command on the./.secrets/
directory but then when it comes to running thecd_work()
function the script is not able to processAlternates
andPerms
. The string being passed tocd_work()
is../../../.secrets
which would be correct if the script was being run from the location the submodules .git information was being stored. That relative path leads to a nonexistent folder above the project directory. This value seems to be set by the call inconfigure_paths()
readinggit config core.worktree
.Before this I had not included the
--yadm-repo $REPO_DIR
argument and I was not able to run anygit
commands as the checks inrequire_repo()
do not pass. The value read from$YADM_REPO
by default points to a.git
file for the submodule and not a.git
directory like it expects.Am I not configuring the command or structuring the folders properly to get a configuration like this to work? I appreciate any help in getting past this roadblock and if I need to create an example repository I will do so.
TL;DR:
When trying to work with yadm in a project with submodules, I am unable to successfully run the
yadm status
command without errors.The text was updated successfully, but these errors were encountered: