Is it possible to have git pull
and git push
in one git command?
The syntax like git pull & git push
doesn't suit me completely, since I need to provide my credentials to the server twice: on pull and on push.
So I wondering, is there any workaround for this? I believe it should be, since it's pretty common case when developer pulls remote origin before pushing local changes.
EDIT: I'm using Windows 7/x64, msysgit-utf8 1.7.9
So, unlike SVN, synchronizing your local repository with a remote repository is actually a two-step process: fetch, then merge. The git pull command is a convenient shortcut for this process.
Commits are done locally. Push - pushing sends the recent commit history from your local repository up to GitHub. If you're the only one working on a repository, pushing is fairly simple. If there are others accessing the repository, you may need to pull before you can push.
The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo. It's the counterpart to git fetch , but whereas fetching imports commits to local branches, pushing exports commits to remote branches.
First of all, you can configure _netrc file that will be used by Git, here is the related issue: Git - How to use .netrc file on Windows to save user and password Then you can configure an alias for the command:
git config alias.publish '!git pull && git push'
And just type: git publish
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With