I was working on a git branch other than master. I don’t remember its name. When I was done with it, I did
git add .
git commit -am "foo"
I didn’t push the commits.
I switched to master git co master. I don’t know how to get back to my branch and commit the changes…
Executing
git branchwill list all your local branches. Then you can check out the branch you want:Once you have everything committed correctly on the branch, you can merge it back to master:
Note that you aren’t pushing from your feature branch, but rather merging your feature branch to
masterand then pushingmaster. Feature branches typically aren’t tracking a remote repository, so there’s nowhere for them to push to.