diff --git a/README.md b/README.md index c5ef70c..a16a078 100644 --- a/README.md +++ b/README.md @@ -68,10 +68,6 @@ Default: **true**. Append the `--prune` flag when running `git fetch`, if your g Default: **false**. Normally, git-up will only fetch remotes for which there is at least one local tracking branch. Setting this option to **true** will make git-up always fetch from all remotes, which is useful if e.g. you use a remote to push to your CI system but never check those branches out. -### git-up.rebase.arguments [string] - -Default: **unset**. Additional arguments to pass to `git rebase`. For example, setting this to `--preserve-merges` will recreate your merge commits in the rebased branch. - ### git-up.rebase.auto [true|false] Default: **true**. If this option is set to **false**, git-up will not rebase branches for you. Instead, it will print a message saying they are diverged and let you handle rebasing them later. This can be useful if you have a lot of in-progress work that you don't want to deal with at once, but still want to update other branches. diff --git a/lib/git-up.rb b/lib/git-up.rb index 8e13916..b238a45 100644 --- a/lib/git-up.rb +++ b/lib/git-up.rb @@ -95,9 +95,10 @@ def rebase_all_branches col_width = branches.map { |b| b.name.length }.max + 1 branches.each do |branch| - remote = remote_map[branch.name] + remote = remote_map[branch.name] + curbranch = branch.name.ljust(col_width) + remote_name = repo.config["branch.#{curbranch}.remote"] || "origin" - curbranch = branch.name.ljust(col_width) if branch.name == repo.head.name print curbranch.bold else @@ -127,7 +128,7 @@ def rebase_all_branches log(branch, remote) checkout(branch.name) - rebase(remote) + rebase(remote, remote_name, curbranch) end end @@ -218,11 +219,10 @@ def log(branch, remote) end end - def rebase(target_branch) + def rebase(target_branch, remote_name, branch_name) current_branch = repo.head - arguments = config("rebase.arguments") - output, err = repo.git.sh("#{Grit::Git.git_binary} rebase #{arguments} #{target_branch.name}") + output, err = repo.git.sh("#{Grit::Git.git_binary} pull --rebase #{remote_name} #{branch_name}") unless on_branch?(current_branch.name) and is_fast_forward?(current_branch, target_branch) raise GitError.new("Failed to rebase #{current_branch.name} onto #{target_branch.name}", output+err) diff --git a/lib/git-up/version.rb b/lib/git-up/version.rb index 6248384..962b27d 100644 --- a/lib/git-up/version.rb +++ b/lib/git-up/version.rb @@ -1,3 +1,3 @@ class GitUp - VERSION = "0.5.12" + VERSION = "0.5.12.1" end