How to Push, Pull and Work with Git in Visual Studio Code or Other IDE’s.
Step 1: Login to the github.com or Sign up.
Step 2: Create a new Repository.
There you need to choose whether the repo must be public or private and you can initialize README.md if you needed.
Step 3: Say, Open Visual Studio Code and create a floder “Test Program”.and create new python file in it TestProgram.py.
now , Open Terminal in VS code and Type.
Step 4: $ > git init
Step 5: $ > git add ‘.\Test Program\TestProgram.py’
Step 6: $ > git commit -m “Initial Commit”
Step 7: $ > git remote add origin <link of your repo>
Step 8: $ > git remote -v
Step 9:
i).if you have created README.md file automatically while creating repo. you need to pull the origin to local before initial commit.
$ > git pull origin master — allow-unrelated-histories
ii).if you haven’t created README.md file. you can push the local repo to origin.
$ > git push -u origin master
For further updating the local to origin do these steps..,
- $> git add ‘\Test Program\TestProgram.py’
- $> git commit -m “Version 1.0.1”
- $> git remote add origin <link of your repo>
- $> git remote -v
- $> git push -u origin master.