git checkout dev
git add <the_changed_files_you_want_to_add>
git commit
git push origin dev
В идеальной ситуации приведенных выше команд должно быть достаточно.
git checkout dev
может произойти сбой из-за конфликтов, которые могут привести к жалобе
error: Your local changes to the following files would be overwritten by checkout:
....
Please commit your changes or stash them before you switch branches.
Если это так, вы можете попробовать:
# commit the changes on "master"
git add <the_changed_files_you_want_to_add>
git commit
# if there are any changed files left
git stash
# if "git stash" is not run here, DON'T run "git stash pop" in the end
# create the local dev and apply the new commit
git checkout dev
git cherry-pick master
# if there are any conflicts, open and edit the conflicted files and resolve them and then
git add <conflicted_files>
git cherry-pick --continue
# push the local dev to the server
git push origin dev
# restore and clean the local master
git checkout master
# discard the commit whose changes you want to be on "dev"
git reset HEAD^ --hard
# only if "git stash" was run
git stash pop