Push single files/commits from local branch to separate remote branch

Viewed 36

I have a local branch that I would like to branch off of, update just one file, and then push that one file to a separate remote branch. I am getting a git error error: src refspec remote_branch_name does not match any. I need to do this because the remote app uses mongo, and my computer cant install mongo because of various version issues. I have a working remote branch of the app without mongo and this is why I need to push up individual files. My process is this:

git checkout local_working_branch

create new branch off of this local branch

git checkout -b local_working_branch_clone

make updates to one file

git add local_file_path
git commit -m "updates to local file"
git push origin remote_branch_name

Is it possible to do this in another way?

0 Answers
Related