summaryrefslogtreecommitdiff
path: root/internal/sync/git_operations.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-06-27 23:00:53 +0300
committerPaul Buetow <paul@buetow.org>2025-06-27 23:00:53 +0300
commit631d6765ce85678a1a5e9dcf9118dc567414be92 (patch)
tree399dc7407f05fbbfe1ba6442641ddd099c20603b /internal/sync/git_operations.go
parent15d06422f80ad7b9b10e5dc28104d3ba3abb2085 (diff)
feat: sync git tags
Diffstat (limited to 'internal/sync/git_operations.go')
-rw-r--r--internal/sync/git_operations.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/sync/git_operations.go b/internal/sync/git_operations.go
index dab573f..b5f3016 100644
--- a/internal/sync/git_operations.go
+++ b/internal/sync/git_operations.go
@@ -53,7 +53,7 @@ func mergeBranch(remoteName, branch string) error {
// pushBranch pushes a branch to a remote
func pushBranch(remoteName, branch string, remoteHasBranch bool) error {
- cmd := exec.Command("git", "push", remoteName, branch)
+ cmd := exec.Command("git", "push", remoteName, branch, "--tags")
output, err := cmd.CombinedOutput()
if err != nil {
@@ -69,7 +69,7 @@ func pushBranch(remoteName, branch string, remoteHasBranch bool) error {
if isBranchMissing(outputStr) {
fmt.Printf(" Creating new branch on %s\n", remoteName)
// Try again with -u flag to set upstream
- cmd = exec.Command("git", "push", "-u", remoteName, branch)
+ cmd = exec.Command("git", "push", "-u", remoteName, branch, "--tags")
if err := cmd.Run(); err != nil {
return fmt.Errorf("failed to push to %s: %w", remoteName, err)
}
@@ -123,8 +123,9 @@ func getRemotesList() (map[string]bool, error) {
// fetchRemote fetches from a single remote with error handling
func fetchRemote(remote string) error {
fmt.Printf("Fetching %s\n", remote)
- cmd := exec.Command("git", "fetch", remote, "--prune")
+ cmd := exec.Command("git", "fetch", remote, "--prune", "--tags")
output, err := cmd.CombinedOutput()
+
if err != nil {
// Check if it's because the repository doesn't exist
if isRepositoryMissing(string(output)) {