Commit f1aac525 authored by Moritz Sokoll's avatar Moritz Sokoll 💬
Browse files

added branch command and log command

parent df00fad5
......@@ -37,17 +37,36 @@ function! Git_Checkout()
elseif matchstr(branch_name, ' ') == ' '
echo 'branch names cannot have spaces in them'
else
let stat = system('git checkout -b ' . branch_name)
let stat = system('git checkout ' . branch_name)
echo stat
endif
endfunction
function! Git_Branch()
echo system('git branch --list')
let branch_name = input('new branch name: ')
echo ''
if len(branch_name) < 1
echo 'name too short'
elseif matchstr(branch_name, ' ') == ' '
echo 'branch name does not allow spaces'
else
echo system('git branch ' . branch_name)
endif
endfunction
function! Git_Status()
echo system('git status')
endfunction
function! Git_Log()
echo system('git --no-pager log --pretty=oneline --graph')
endfunction
command! GitCommit call Git_Commit()
command! GitPush call Git_Push()
command! GitCheckout call Git_Checkout()
command! GitStatus call Git_Status()
command! GitBranch call Git_Branch()
command! GitLog call Git_Log()
let g:git_control_loaded = 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment