0% found this document useful (0 votes)
109 views9 pages

GITHUB - Part 1

1) Create a GitHub account and repository, then clone the repository locally to your computer using either SSH or HTTPS. 2) Make changes to files locally, then push those changes back up to GitHub using various Git commands like git add, git commit, and git push. 3) You can also create new files locally and add them to your repository on GitHub before pushing your changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views9 pages

GITHUB - Part 1

1) Create a GitHub account and repository, then clone the repository locally to your computer using either SSH or HTTPS. 2) Make changes to files locally, then push those changes back up to GitHub using various Git commands like git add, git commit, and git push. 3) You can also create new files locally and add them to your repository on GitHub before pushing your changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

GITHUB – PART-1

1) Create a GitHub account using https://github.com/. Use your personal email address and official
emails come with restrictions.

2) Create a new repository (it’s a container where all stuff goes) using the + sign as shown below:

3) Provide the necessary details like repository name. Select repository as Public and initialize the
READMD. Click ‘Create’
4) Now, your repository is created, and it looks as:

5) To download the repository, we have option ‘Clone and download’. Also, there are two options
to copy repository locally using ‘SSH’ and ‘HTTPS’
6) Copy the SSHRepositoryLink on to your clipboard.
7) These instructions presume that you have SSH key generated. However, if you don't have one
please follow the step-by-step procedure in this link
(https://help.github.com/en/enterprise/2.15/user/articles/generating-a-new-ssh-key-and-
adding-it-to-the-ssh-agent ) before you proceed further.

8) Open the command prompt or terminal to use the GitHub commands:


To change the directory simply use:
cd <name of the directory you want to change to>
To go to the folder “Downloads” use: cd Downloads
Create a empty folder in Downloads using SSH repository link that we have created in GitHub
Repository as:
git clone pastesshrepositorylinkhere

Now, the folder is copied to my ‘Downloads’. Just check the ‘Downloads’ have you got the folder
demo?

9) To check my folder, enter the folder using cd command again as:


cd demo

10) Get the list of the files in the folder demo, use:
For Windows: dir
For Mac: ls
11) To view the content of the file:
For Windows: type README.md
For Mac: cat README.md

12) To open a README.md file:


For Windows: notepad README.md
For Mac: open README.md

13) To create a new file:


For Windows: notepad test.txt
For Mac: vi test.txt

14) Add to the repository:


For Windows/Mac: git add test.txt

Check the status of the file using:


git status
Similarly, add the new file as shown below:

Commit the changes in the repository using:


git commit -m “write message here”

Push the file to remote repository using:


git push
Now, this make the changes in my GitHub repository

Create a repository now without README.md file

Copy the SSHRepositoryLink on to your clipboard just as in Step 6.

To come out from the demo folder first use


cd ..
To make a directory in download folder:
mkdir demo1
cd demo1

To create a readmd file use


echo "# demo1" >> README.md

Initialize the directory

git init

Create and add a README.md file. You can use a normal text editor
depending on which OS you are using.

git add README.md

Check the status of the file

git status

Commit the changes

git commit -m "first commit"

Add the origin where we have to push the file. This is the
SSHRepositoryLink you copied when you created the repository.

git remote add origin [email protected]:mskill/demo1.git

Push the file

git push -u origin master


Now, the README.md file is created in our repository

You might also like