0% found this document useful (0 votes)
39 views3 pages

GIT Setup and Basic Commands

The document provides instructions for setting up Git and GitHub for source control. It includes steps to install Git and Tortoise Git, generate an SSH key, clone a GitHub repository, make changes to files and create new files/folders, commit changes locally, push the changes to a new branch on the remote repository, and raise a pull request.

Uploaded by

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

GIT Setup and Basic Commands

The document provides instructions for setting up Git and GitHub for source control. It includes steps to install Git and Tortoise Git, generate an SSH key, clone a GitHub repository, make changes to files and create new files/folders, commit changes locally, push the changes to a new branch on the remote repository, and raise a pull request.

Uploaded by

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

GIT Topic Lab

1.Create signin in github.com


2. Create a test repository for 4 members / Create individual repo for
Private, Add Read me, Add gitignore None, License None and click Create
Repository

3. Download https://git-scm.com/downloads

Download and install Tortoise GIT


https://tortoisegit.org/download/

GIt Commands

Create folder by name Demo from your machine

open git bash and type below


cd ~/.ssh
cat ~/.ssh/id_rsa.pub

Copy and paste content in SSH and GPG keys of your account settings through web
application github.com

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-
a-new-ssh-key-and-adding-it-to-the-ssh-agent

ssh-keygen
ssh -T git@github.com

for old format


ssh-keygen -m PEM -t rsa -P "" -f afile

Santosh@DESKTOP-8V5OM9F MINGW64 /e/TestGuys (master)


$ ssh -T git@github.com
Hi santoshnn! You've successfully authenticated, but GitHub does not provide shell
access.

1. Precondtion
install: git tortoise and git scm bash
Setup : SSH key in Git Repo
2. Cloning the project
git clone git@github.com:santoshnn/Demo.git -- done
cd Demo/
3. Modify existing file , new File and new Folder
3.1 Modify text in README.md
vi README.md -- done

3.2 Add new File in root dir


vi newFile1.txt
add some text to it and Save it (Esc ! wq ) -- done

3.3. Add new folder with file in it.


mkdir newFolder1
vi newFolder1/newFile1
add some text to it and save it . -- done

4. Check the modified


git status -- done ( red files)
git diff README.md

5. Add files which you wish to commit


git add README.md
git add newFile1.txt
git add newFolder1/ -- done

git status -- done ( red files turns green)

6. Commit changes (changes will be commited to local not at remote branch)


git commit -m "new changes"
git status -- done ( no files)

7. view comment detail


git log (new changes shown with commit comment)
git log -3 -- done

8. Push changes to remote


8.1 View remotes and get remote name (it will be used in 8.4 step)
git remote -v

8.2 Create new branch if not there


git checkout -b newBranch

8.3 check branchs


git branch
8.4 push branch/changes
git push origin newBranch

$ git push origin newBranch


Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (6/6), 486 bytes | 243.00 KiB/s, done.
Total 6 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for 'newBranch' on GitHub by
visiting:
remote: https://github.com/santoshnn/Demo/pull/new/newBranch
remote:
To github.com:santoshnn/Demo.git
* [new branch] newBranch -> newBranch

8.5 Check branch and changes in github.com project code UI

9. Raise Pull Request

git.exe clone --progress -v "https://github.com/santoshnn/Demo.git" "E:\Demo1\Demo"


Cloning into 'E:\Demo1\Demo'...

git config --system --unset credential.helper

git remote -v
ssh -Tv git@github.com

ssh-keygen -t rsa -C "navale.santosh@gmail.com"


git remote set-url --add origin git@github.com:santoshnn/TestNew.git

git rm --cached -r

https://crontab.guru/

https://download.oracle.com/java/17/archive/jdk-17.0.4.1_windows-x64_bin.exe

FOR %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-
ClientTools-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F")
FOR %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-
ClientExtensions-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F")

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy