Reputation: 1
I am wondering how I can create a local git branch in Visual Studio for Mac 8.9 and then push it to the server. I tried clicking on Version Control -> Manage Branches and Remotes. Then I tapped on the ‘New’ button, typed in a name for the branch. When I tap on OK I get a local branch but I can’t seem to figure out how to push that branch to the server.
Upvotes: 0
Views: 1143
Reputation: 314
I assume you are trying to push a new project that you have created to GitHub. Let me help you with the step by step process to do that.
Open the terminal in VS code first.
git init -b main
.git status
to verify the changes you want to push.git add .
for that.git commit -m "custom message"
. Note you can type any commit message here.6. Now you need to set the remote for that you can use git remote add origin <REMOTE_URL>
replace the REMOTE_URL with the repository URL that you copied in the 5th step.
7. Everything is setup now you just need to push your changes for that you can use the command git push origin main
. This will push your changes to the main branch that we created in the first step.
After doing all this you should be able to see your changes on github for more detailed steps you can check this out . https://docs.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line
Hope this helps
Upvotes: 1