How to move components from VS Code to GITHUB using GIT Commands for the first time to a new repository?

How to move components from VS Code to GITHUB using GIT Commands for the first time to a new repository?

The following steps is for moving Salesforce Components from Visual Studio Code to GITHUB.

1. Setup VS Code with Salesforce Extensions. Create a Project with Manifest and retrieve the components to push it to GITHUB. If you need any help on this, check the following link.

https://www.infallibletechie.com/2018/09/how-to-install-and-set-up-vs-code-for.html

2. Use the following commands in VS Code Terminal to move the components.

1. Initialize GIT using the following command.

git init

2. To add all the components, use the following command.

git add *

3. For the first commit, use the following command.

git commit -m "initial commit" 

4. To map it as Main branch, use the following command.

git branch -M main

5. To add components to your GIT Repository, use the following command.

git remote add origin <URL of your GIT Repository ending with .git>

6. To push the changes from local to GIT Repository, use the following command.

git push -u origin main

Leave a Reply