Lab 3
Lab 3
Objective:
To learn how to create a Git repository, make commits, and push changes to GitHub.
Prerequisites:
Git is a distributed version control system. It’s a system that records changes of our files over
time.
--distributed-even-if-your-workflow-isnt
Lab Steps:
1. Install Git:
o Download and install Git from Git's official website.
2. Set Up Git Configuration: Open a terminal and configure your Git username and
email:
3. Create a GitHub Account: If you don't have a GitHub account, create one at
GitHub's website.
1. Get the Repository URL: On your repository page on GitHub, click the green
"Code" button and copy the URL.
2. Clone the Repository: Open a terminal and run:
cd my-first-repo
code .
2. Create a New File: In VS Code, create a new file called hello.txt and add some text
to it.
3. Check Git Status:
git status
4. Add Changes to Staging Area:
git add hello.txt
5. Commit Changes:
git commit -m "Add hello.txt with initial content"
1. Push to GitHub:
1. Create Another File: Create another file called goodbye.txt and add some content.
2. Repeat the Process:
o Add the file to the staging area.
o Commit the changes.
o Push the changes to GitHub.
Check out:
Branching and Merging: Explore creating branches using git branch and git
checkout -b branch_name, and learn to merge using git merge.
Pull Requests: Learn how to create pull requests on GitHub for collaborative work.
GitHub Pages: If you're interested in hosting a static site, explore GitHub Pages.
Additional Resources: