From 4f8f2c801631a8c1161fbf06232e70811ec1a2fe Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Tue, 6 Dec 2022 19:15:03 +0530 Subject: [PATCH] nvim: autoload/git: Set upstream when checking out remote branch --- nvim/.config/nvim/autoload/git.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/nvim/.config/nvim/autoload/git.vim b/nvim/.config/nvim/autoload/git.vim index 5d84822..65f5e81 100644 --- a/nvim/.config/nvim/autoload/git.vim +++ b/nvim/.config/nvim/autoload/git.vim @@ -32,6 +32,7 @@ function! git#git_branch_checkout() abort let remote = join(branch[1:2], "/") silent execute "keepalt Git checkout " . remote silent execute "keepalt Git checkout -b " . branch[2] + silent execute "keepalt Git branch --set-upstream-to=" . remote . " " . branch[2] endif silent execute "keepalt bw" endfunction