Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The library is not added to the git via the git subtree

I added the GLFV library to the project, through the git subtree, but this warning came out "It looks like either your git installation or yourgit-subtree installation is broken". Several reasons have also been described why this may be:

  • If git --exec-path does not print the correct path to your git install directory, then set the GIT_EXEC_PATH environment variable to the correct directory.

  • Make sure that your git-core \ git-subtree file is either in your PATH or in your git exec path (C: / Program Files / Git / mingw64 / libexec / git-core).

  • You should run git-subtree as git core \ git-subtree, not as git-core \ git-subtree.

I checked the link to the library is correct, the file "git-subtree" is there, why then the error pops up.

like image 596
Денис Трофимов Avatar asked Jun 15 '21 16:06

Денис Трофимов


People also ask

How do I create a subtree in git?

Adding a subtreeSpecify the prefix local directory into which you want to pull the subtree. Specify the remote repository URL [of the subtree being pulled in] Specify the remote branch [of the subtree being pulled in] Specify you want to squash all the remote repository's [the subtree's] logs.

How do you push a subtree?

To push commits back to a subtree, select the (remote) subtree branch in the Branches view and invoke Remote|Subtree|Push. Pushing a subtree involves splitting changes back from main repository to subtree repository (more details can be found below).

How does git Subtrees work?

git subtree lets you nest one repository inside another as a sub-directory. It is one of several ways Git projects can manage project dependencies. Management of a simple workflow is easy. Older version of Git are supported (even older than v1.

What is git subtree split?

Use git subtree split to extract the files you want to the an intermediate branch in your repository (you have already done this).


1 Answers

It appears the git subtree installation is broken issue is with Git for Windows.

I was able to download an older version from: https://github.com/git-for-windows/git/releases/download/v2.31.0.windows.1/Git-2.31.0-64-bit.exe

This fixed the issue for me while we await a fix. There's an issue on Git for Window's GitHub for the git subtree error.

I got the below error:

It looks like either your git installation or your git-subtree installation is broken.

It looks like either your git installation or your git-subtree installation is broken.

Tips:
 - If `git --exec-path` does not print the correct path to
   your git install directory, then set the GIT_EXEC_PATH
   environment variable to the correct directory.
 - Make sure that your `git-core\git-subtree` file is either in your
   PATH or in your git exec path (`C:/Program Files/Git/mingw64/libexec/git-core`).
 - You should run git-subtree as `git core\git-subtree`,
   not as `git-core\git-subtree`.

If you wouldn't mind, please accept this as the answer.

like image 152
Kyle Avatar answered Oct 02 '22 16:10

Kyle