0% found this document useful (0 votes)
52 views6 pages

Devops Exp 2

The document is a manual for a DevOps lab experiment focused on exploring Git and GitHub commands. It includes steps for creating a GitHub account, generating a personal access token, and common Git commands for managing repositories. Additionally, it provides practical examples of using Git commands in a terminal environment.

Uploaded by

rajanirk
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)
52 views6 pages

Devops Exp 2

The document is a manual for a DevOps lab experiment focused on exploring Git and GitHub commands. It includes steps for creating a GitHub account, generating a personal access token, and common Git commands for managing repositories. Additionally, it provides practical examples of using Git commands in a terminal environment.

Uploaded by

rajanirk
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/ 6

DevOps lab

manual
EXPERIMENT-2:

2)Explore Git and GitHub commands.

 Create/Login into your GitHub account

 Create a public repository

Sai Spurthi Institute Of 1


Technology
DevOps lab
manual

 Navigate to your repository and copy the HTTPS link for cloning the remote repository to
local repository

TOKEN GENERATION :

 Follow the given path to generate the token


 Open settings in your git profile.

Sai Spurthi Institute Of 2


Technology
DevOps lab
manual
 In settings, open developer settings.

 Open personal access tokens.

 Open generate new token(classic).

 Press generate token.

Sai Spurthi Institute Of 3


Technology
DevOps lab
manual
 Token is generated and copy the generated token.

Sai Spurthi Institute Of 4


Technology
DevOps lab
manual
Common Commands
 Mkdir :Creates a new directory(folder).
 cd :Changes the current directory to a specified directory.
 ls :Lists the contents of the current directory.
 ls -a :Lists all contents of the directory, including hidden files(files starting with .)
 vi <filename> : Open the file in vi. If the file doesn’t exist ,it will be created.
o i Insert text
o Esc Exit insert mode and return to command mode
o :wq Save and quit

Git Commands
 git -v : Displays the version of Git installed in your system.
 git clone <repository url> :Clones an existing repository from a remote location(eg:GitHub).
 git init :Initializes a new Git repository
 git status :Shows the working directory status,including changes and untracked files.
 git add <file> :Adds a specific file to the storing area.
 git commit -m “commit message” :Commits changes in the staging area with a message.
 git config user.name <username> :Sets the name you want attached to your
commit transactions.
 git config user.email <email> :Sets the email you want attached to your commit transactions.
 git push -u origin :Pushes your local branch to the remote repository at origin.
 git log :Shows the commit history
 git log --oneline :Each commit is shown on a single line,including the abbreviated commit
hash and commit message.

Practicing git commands:


STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539
$ mkdir lab1

STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539


$ git -v

git version 2.46.1.windows.1

STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539


$ git clone https://github.com/Nagaraju1572/lab1.git

Cloning to ‘labexperiment1’...
Warning: you appear to have cloned an empty repository.
STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539
$ cd lab1/

STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539/lab1


$ ls -a
./ ../ lab1/

STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539/lab1


$ cd lab1
STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539/lab1/lab1 (main)

Sai Spurthi Institute Of 5


Technology
DevOps lab
manual
$ git status
On branch main

No commits yet

Untracked files:
(use "git add <file>..." to include in what will be committed) index.html

nothing added to commit but untracked files present (use "git add" to track)
STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539/lab1/lab1 (main)
$ git add index.html
warning: in the working copy of 'index.html', LF will be replaced by CRLF the next time Git touches it

STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539/lab1/lab1 (main)


$ git add index.html

STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539/lab1/lab1 (main)


$ git config user.name "Nagaraju1572"

STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539/lab1/lab1 (main)


$ git config user.email "[email protected]"

STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539/lab1/lab1 (main)


$ git commit -m "created registration page"
[main (root-commit) 70f51bc] created registration page
1 file changed, 53 insertions(+) create mode
100644 index.html
STUDENT@SAIS-LAB02-39 MINGW64 /d/devops539/lab1/lab1 (main)
$ git status
On branch main
Your branch is based on 'origin/main', but the upstream is gone. (use "git branch
--unset-upstream" to fixup)

nothing to commit, working tree clean

Sai Spurthi Institute Of 6


Technology

You might also like