Reputation: 13759
I realized that after a commit in VSCode there's a "Push" menu option that pushes the commit to the default branch.
However, I often need to push it as well to different branches. Is there a way to do this or run git push --progress "origin" DEFAULT_BRANCH:OTHER_BRANCH
through VSCode?
Upvotes: 26
Views: 113629
Reputation: 1
git push an existing project to GitHub git init git add . git commit -m "Add existing project files to Git" git remote add origin https://github.com/cameronmcnz/example-website.git git push -u -f origin master
Upvotes: -1
Reputation: 13759
On the Source Control tab (Ctrl+⇧+G or ^+⌘+G on Mac), press ⃛ to access Git commands dropdown menu:
Switch to the branch to push – Branch > Create Branch OR Checkout to... > ➕ Create New Branch
Press the Commit & Push button (if not visible, press ⌄ under the Message text box)
two popups will show up for you to confirm staging, committing and pushing of your changes to this new branch
Alternative using only menu options:
All above options can be accessed through commands F1 (Mac: fn+F1 or ⇧+⌘+P) and typing git [command], e.g. "git checkout".
For previous versions, check this answer's timeline.
Upvotes: 39