Is it possible to push changes to a remote repository without commiting to the master branch? I use the remote repo just for deploying.
No, you must make a commit before you can push. What is being pushed is the commit (or commits).
To push the commit from the local repo to your remote repositories, run git push -u remote-name branch-name where remote-name is the nickname the local repo uses for the remote repositories and branch-name is the name of the branch to push to the repository. You only have to use the -u option the first time you push.
You can do a forced push. The forced push will erase all commit history of the remote repository's branch, and replace it to your branch. Check the answers for doing forced pushes in "How do I properly force a Git push?".
You can create an empty commit and push that: git commit --allow-empty
No, there is no way to do that, as it would completely oppose the whole "git strategy", I guess. I don't know about your deployment system, but I guess a good way to do what you are trying to is to work on different branches (that is, on for development and one which gets deployed when pushed to), and merging the changes you want to be deployed from your development-branch into your live branch.
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