@@ -17,6 +17,7 @@ nnoremap <Leader>gl :GitLog<Enter>
17
17
nnoremap <Leader> ga :GitAdd<Enter>
18
18
nnoremap <Leader> gA :GitAdd <cfile><Enter>
19
19
nnoremap <Leader> gc :GitCommit<Enter>
20
+ nnoremap <Leader> gp :GitPullRebase<Enter>
20
21
21
22
" Ensure b:git_dir exists.
22
23
function ! s: GetGitDir ()
@@ -142,10 +143,27 @@ function! GitCheckout(args)
142
143
call GitDoCommand (' checkout ' . a: args )
143
144
endfunction
144
145
146
+ " Push.
147
+ function ! GitPush (args )
148
+ " call GitDoCommand('push ' . a:args)
149
+ " Wanna see progress...
150
+ let args = a: args
151
+ if args = ~ ' ^\s*$'
152
+ let args = ' origin ' . GitBranch ()
153
+ endif
154
+ execute ' !' g: git_bin ' push' args
155
+ endfunction
156
+
157
+ " Pull.
158
+ function ! GitPull (args )
159
+ " call GitDoCommand('pull ' . a:args)
160
+ " Wanna see progress...
161
+ execute ' !' g: git_bin ' pull' a: args
162
+ endfunction
163
+
145
164
" Show commit, tree, blobs.
146
165
function ! GitCatFile (file )
147
166
let file = s: Expand (a: file )
148
- " let file_type = s:SystemGit('cat-file -t ' . file)
149
167
let git_output = s: SystemGit (' cat-file -p ' . file )
150
168
if ! strlen (git_output)
151
169
echo " No output from git command"
@@ -250,3 +268,6 @@ command! -nargs=1 GitCatFile call GitCatFile(<q-args>)
250
268
command ! -nargs =+ Git call GitDoCommand (<q-args> )
251
269
command ! GitVimDiffMerge call GitVimDiffMerge ()
252
270
command ! GitVimDiffMergeDone call GitVimDiffMergeDone ()
271
+ command ! GitPull call GitPull (<q-args> )
272
+ command ! GitPullRebase call GitPull (' --rebase' )
273
+ command ! GitPush call GitPush (' ' )
0 commit comments