branch: elpa/git-commit
commit 8bbe8c15e04a2901b7b5c2f5bbef83299b417db5
Author: Pratyush Yadav <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    magit-{fetch,pull}: Add --force
    
    git pull and git fetch allow the "--force" switch to force update local
    branches.  From man git-fetch(1):
    
        -f, --force
            When git fetch is used with <src>:<dst> refspec it may refuse
            to update the local branch as discussed in the <refspec> part
            below. This option overrides that check.
    
    Add that option to `magit-pull' and `magit-fetch'.  Use "-F" as the
    suffix to be consistent with `magit-push'.
---
 lisp/magit-fetch.el | 3 ++-
 lisp/magit-pull.el  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/magit-fetch.el b/lisp/magit-fetch.el
index d19910f5e9..a82d6e2303 100644
--- a/lisp/magit-fetch.el
+++ b/lisp/magit-fetch.el
@@ -37,7 +37,8 @@
   ["Arguments"
    ("-p" "Prune deleted branches" ("-p" "--prune"))
    ("-t" "Fetch all tags" ("-t" "--tags"))
-   (7 "-u" "Fetch full history" "--unshallow")]
+   (7 "-u" "Fetch full history" "--unshallow")
+   ("-F" "Force" ("-f" "--force"))]
   ["Fetch from"
    ("p" magit-fetch-from-pushremote)
    ("u" magit-fetch-from-upstream)
diff --git a/lisp/magit-pull.el b/lisp/magit-pull.el
index ae50cde5f3..d218c72c56 100644
--- a/lisp/magit-pull.el
+++ b/lisp/magit-pull.el
@@ -47,7 +47,8 @@
    (lambda () (if magit-pull-or-fetch "Pull arguments" "Arguments"))
    ("-f" "Fast-forward only" "--ff-only")
    ("-r" "Rebase local commits" ("-r" "--rebase"))
-   ("-A" "Autostash" "--autostash" :level 7)]
+   ("-A" "Autostash" "--autostash" :level 7)
+   ("-F" "Force" ("-f" "--force"))]
   [:description
    (lambda ()
      (if-let ((branch (magit-get-current-branch)))

Reply via email to