Skip to content
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

Submodule Update #500

Open
Tynukua opened this issue Jul 14, 2024 · 1 comment
Open

Submodule Update #500

Tynukua opened this issue Jul 14, 2024 · 1 comment

Comments

@Tynukua
Copy link

Tynukua commented Jul 14, 2024

GitGetter.update fails if repo contains submodule

package main

import (
	"github.com/hashicorp/go-getter"
	"log"
	"os"
)

func main() {
	repoURL := "git@github.com:mayraamaral/submodule-father.git" // repo contains submodule
	destDir := "repo"
	for i := 0; i < 2; i++ {
		err := getter.GetAny(destDir, repoURL) // fails when i == 1
		if err != nil {
			log.Println(err)
		}
	}
}
@Tynukua
Copy link
Author

Tynukua commented Jul 14, 2024

problem caused by rm .git
but submodules have own .git modules
the solution cud be

  1. recursive removing all submodules, including all directory with files
  2. actually update repo but not removing .git folder f.e. git pull --rebase
  3. stop using update method and instead rm all dir and use clone method again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant