0% found this document useful (0 votes)
5 views

Week 3 - Task

This document provides a step-by-step guide for installing Git, creating a local repository, and managing files using Git commands. It includes instructions for setting up a GitHub account, pushing local changes to a remote repository, and cloning repositories. Additionally, it outlines tasks related to branching and merging, as well as using a graphical user interface (GUI).

Uploaded by

thapakrishog
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Week 3 - Task

This document provides a step-by-step guide for installing Git, creating a local repository, and managing files using Git commands. It includes instructions for setting up a GitHub account, pushing local changes to a remote repository, and cloning repositories. Additionally, it outlines tasks related to branching and merging, as well as using a graphical user interface (GUI).

Uploaded by

thapakrishog
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Task 1

1. Download Git from here https://git-scm.com/ (Version 2.26.2)


2. Install Git (Installation Guide: https://www.youtube.com/watch?v=SWYqp7iY_Tc)
3. Create a Folder in Desktop with name “L3” and Right Click on folder L3 and Select Git
Bash Here. You will see this screen

4. Check git version


 git --version
5. Now add files with this Command:
 touch index.html
 touch about.html
 touch resources.txt

6. Check your Folder, you will see these files

7. Open your file index.html in notepad or notepad++. Add these lines of code & save
<html>
<head>
<title> My Title </title>
</head>
<body>
My First Page
</body>
</html>
8. Open resources.txt and Write your name and Save this file
9. Initialize a Git repository/working directory
 git init

 Check your Folder, you will see .git folder. And within this folder you will find
Git Related Folders and files.

10. Configure user name and email


 git config --global user.name ‘Your Name’
 git config --global user.email ‘[email protected]
11. Check Status of Working directory
 git status
12. Add file or files
 git add index.html / git add .
 git add .
13. Check Status of Working directory
 git status

14. Commit chages in your working directory


 git commit
 git commit –m “Some git commit message”
 Press ‘i’ to enable insert mode & type some text like Initial Commit or
any text
 To Exit - Press ‘Esc’ Key and type ‘:wq’

15. After all commit, Check Status of Working directory (This will show you message like
nothing to commit, working tree clean)
 git status
16. Make changes to resources.txt. Add few names of your friends
17. Check with git status, it will show (changes not staged for commit)
 git status
18. Add file or files
 git add .
19. Commit chages in your working directory with commit message
 git commit -m ‘Changed resouces.txt’
20. Check with git status, it will show (changes not staged for commit)
 git status

21. View commit history


 git log
Task 2 – Git & Github
1. Create an account on Github.com
2. Use Git Bash and Follow these commands:
 git remote
 git remote add origin https://github.com/youraccountname/reponame.git

Ex - git remote add origin https://github.com/amaharjantbc/L3Sample.git


 git remote
 git push -u origin master

- Enter your github username/email and password


- Then in github.com, reload your repository page & see your added files
3. Clone Github Repository
 git clone https://github.com/youraccountname/reponame.git

Task 3 – Branch & Merge

Task 4 – GUI

You might also like