Skip to content

Commit

Permalink
Remove branch name from push
Browse files Browse the repository at this point in the history
It is possible to specify an alternative default initial branch for git
repositories. This is globally configurable with **init.defaultBranch**.
See `man git-init` for details.

We should be able to rely on pushing and pulling from the default
branch without explicitly setting "master", or anything else. dstask
will simply push and pull from the remote named "origin" using whatever
default tracking branch is set.

Refs naggie#116
  • Loading branch information
dontlaugh committed Mar 31, 2021
1 parent 519a850 commit bf18e2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@ func EnsureRepoExists(repoPath string) {
// Sync performs a git pull, and then a git push. If any conflicts are encountered,
// the user will need to resolve them.
func Sync(repoPath string) {
MustRunGitCmd(repoPath, "pull", "--no-rebase", "--no-edit", "--commit", "origin", "master")
MustRunGitCmd(repoPath, "pull", "--no-rebase", "--no-edit", "--commit", "origin")
MustRunGitCmd(repoPath, "push", "origin", "master")
}

0 comments on commit bf18e2a

Please sign in to comment.