Skip to content

Instantly share code, notes, and snippets.

@taciturnaxolotl
Created April 7, 2025 19:45
Show Gist options
  • Select an option

  • Save taciturnaxolotl/168d2626eacd378eecedb65bfdd07753 to your computer and use it in GitHub Desktop.

Select an option

Save taciturnaxolotl/168d2626eacd378eecedb65bfdd07753 to your computer and use it in GitHub Desktop.
Go git clone mvp test
package main
import (
"fmt"
"os/exec"
)
func main() {
source := "https://tangled.sh/@tangled.sh/core"
repoPath := "core" // local folder name
// Bare clone
cmd := exec.Command("git", "clone", "--bare", source, repoPath)
out, err := cmd.CombinedOutput()
if err != nil {
fmt.Printf("Clone error: %v\n%s\n", err, out)
return
}
// Set hidden refs config
cmd = exec.Command("git", "-C", repoPath, "config", "receive.hideRefs", "refs/hidden")
out, err = cmd.CombinedOutput()
if err != nil {
fmt.Printf("Config error: %v\n%s\n", err, out)
return
}
fmt.Println("Bare clone and config completed successfully.")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment