Created
April 7, 2025 19:45
-
-
Save taciturnaxolotl/168d2626eacd378eecedb65bfdd07753 to your computer and use it in GitHub Desktop.
Go git clone mvp test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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