summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-11-17 18:15:32 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-11-21 22:07:14 +1100
commitcea24c2cf98c48e187900041d9e3bbeb93596019 (patch)
tree2390449a308f689470f6e944c2a317b89718ee9f /pkg/commands
parent64017cf8745258cc6d4838a602295b8281585b9f (diff)
allow editing remotes
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 9dda1b2d2..76c753940 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -1091,3 +1091,11 @@ func (c *GitCommand) DeleteRemoteBranch(remoteName string, branchName string) er
func (c *GitCommand) SetBranchUpstream(remoteName string, remoteBranchName string, branchName string) error {
return c.OSCommand.RunCommand(fmt.Sprintf("git branch --set-upstream-to=%s/%s %s", remoteName, remoteBranchName, branchName))
}
+
+func (c *GitCommand) RenameRemote(oldRemoteName string, newRemoteName string) error {
+ return c.OSCommand.RunCommand(fmt.Sprintf("git remote rename %s %s", oldRemoteName, newRemoteName))
+}
+
+func (c *GitCommand) UpdateRemoteUrl(remoteName string, updatedUrl string) error {
+ return c.OSCommand.RunCommand(fmt.Sprintf("git remote set-url %s %s", remoteName, updatedUrl))
+}