Using Git Bash and Using Git on VSC
- Understand Source control, it's importance when working on group projects
Unknown...
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
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)
git pull
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
- Additional notes
- The homework