GIT in Visual Studio Code
Visual Code Installation
Step1: To download Visual Studio Code go to the below-mentioned link
https://code.visualstudio.com/download
Step2: Select Visual Code for Windows/Mac to download and Install Vs Code.
Select the open folder option to open a folder in which we need to work.
Open a folder
Step3: Once we open a folder, we can see the name of the folder on the left side.
Step4: We can create a new file or open an existing one.
We have selected a folder
Step5: Select the terminal option to open a PowerShell terminal.
Select the Terminal option to open a PowerShell terminal
The path highlighted in the below image refers to the directory in which we need to work.
The path refers to a gitdemo folder in which this terminal is open
Common git commands
git init : this command will initialise the working directory into a git working directory.
git add demo.txt : this command will stage the file demo.txt
Note: before making a commit, we need to configure the user detail.
git config --global user.email "user_email” : this command will configure the email address
of the user.
git config --global user.name "demo_user" : this command will configure the username.
git commit -m “message” : this command will commit the staged files or folders to local
repository.
git remote add origin <URL of git repository> : This command will link the remote
repository to the directory.
git push origin master : this command will push the files in the local repository to remote
repository.
Select the token option to use personal
access token
Note: we need to enter the token to push to remote repo.
The files have been pushed to remote repository.