Skip to content

Latest commit

 

History

History
67 lines (37 loc) · 1.77 KB

Lesson11-Git v2.md

File metadata and controls

67 lines (37 loc) · 1.77 KB

Lesson

Using Git Bash and Using Git on VSC

Prior Homework assessment

Lesson objectives

  • Understand Source control, it's importance when working on group projects

Lesson time to deliever:

Unknown...

Teacher instruction

Course materials

GIT BASH:

CLONE

git clone repositorylink.git
Eg: git clone https://github.com/changetocoding/WebLessonPlan.git

Right click within the folder you want to clone into and select "Git Bash Here"

After cloning, navigate into the folder to perform operations by typing cd clonedrepositoryfoldername

TO UPDATE/UPLOAD A FILE TO THE REPOSITORY

git add "filename" (this instructs git to start keeping track of the file to be uploaded or updated)

git commit -m "filename" (this commits the file to be uploaded or updated)

git push

(To add all files!!!: git add .)

(To close out of comment window: :wq)

TO GET UP-TO-DATE FILES FROM THE REPOSITORY

git pull

GIT & VS CODE

HOW TO PUSH A PROJECT FROM VSCODE TO GITHUB (TO LINK A REPOSITORY WITH VSCODE)

  • Create a new repository for your project
  • Open the project you want to upload in Vscode
  • Initialise repository from the source control panel
  • Add a remote repository: view, command palette, Git: Add remote (Enter repository url (ensure it ends with the extension of .git) and set a remote name)
  • From your source control panel, enter a message, commit changes and push changes

HOW TO PULL A PROJECT FROM GITHUB TO VSCODE (CLONING A REPOSITORY FROM GITHUB)

  • Go the VSCode: View, Command Palette, Git: Clone (Enter the repository url (ensure it ends with the extension of .git) and select a folder where you want to clone the files)

Note: You can follow same process to clone the repository of someone else

Recommendations

  • Additional notes

Homework

  • The homework