git pull and git push in one go git pull and git push in one go git git

git pull and git push in one go


First of all, you can configure _netrc file that will be used by Git, here the related issue: Git - How to use .netrc file on windows to save user and passwordThen you can configure an alias for command:

git config alias.publish '!git pull && git push'`

And just type: git publish


I recommend doing something just quick and dirty in this case. It may not be the most efficient way to do it, but I would just create a bash script in vim with the commands and run that considering how simple the commands are. Then you can just open that file every time you want to pull and push at the same time.

All you have to do is create the file, put in the two lines of commands you want to write, and type that filename into the command line whenever you want to execute them.

Again, not the most efficient way, but a quick fix.


You'd better use SSH, but if you can't use SSH, you can always use the windows credentials store to save your password so you don't need to fill it in twice:

git config --global credential.helper wincred

Source: Git documentation