Skip to content

psathyanarayan/Git_Session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git_Session

Hello, folks!, I'm P Sathya Narayan

This Repository contains assignemnts and resources of the session Introduction to GIT

How to Install Git

  • After Successfully installing with all Recommended Settings
  • Open your CMD/Terminal
  • Type
git --version

  • Configure your Git
git config ––global user.name “your github_username”
git config ––global user.email “email_address”
  • Now Create a Repository in your Github
  • Copy the repo url

  • Now there are two ways
    • One by cloning this repo
git init
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/psathyanarayan/testtt.git
git push -u origin main 
  • Or by coding then pushing to this repo
git remote add origin https://github.com/psathyanarayan/testtt.git
git branch -M main
git push -u origin main

Creating and changing Branches

  • This creates and changes to the new branch new
git branch new
git checkout new

Version Control

  • I commited 3 chnages to my file
git log --oneline 

Shows all my commit with their SHA1

  • If I need to know what is in the 2nd commit of Hello.py
 git show 66874b6:Hello.py

Where 66874b6 is the shown SHA key when we perform the above step

  • If I need to revert to this change then
git checkout 66874b6 Hello.py

Then normally commit

Your Task

  • First fork this repo

  • Clone this Repo with the below command from your repository
git clone your forked repo url with no quotes

  • Note Before cloning please install git
  • After cloning Open the folder then edit the Hello.py file by adding the below command
print("Your Name Here")
  • Then add this to git by
git add .
  • Then Commit it with a message
git commit -m "Added Your Name"
  • If you have configed git then
git push -u origin main
  • After you pushed to your forked repo You need to create a Pull Request
  • Follow the instructions
  • Click on Pull request after you commited as shown

  • Click on New Pull request

  • Click on Create Pull request as shown

  • Click on Create

  • Wow Congratssss

  • You did great

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages