Skip to content

Latest commit

 

History

History
127 lines (83 loc) · 2.43 KB

gitgithub.md

File metadata and controls

127 lines (83 loc) · 2.43 KB

FOR HACKTOBER FEST CLICK HERE

Git and Github

Installation and Getting Started

  • Google search " Git Download "

  • Download Git and Follow the simple Installation Steps

  • got to Cmd line or Power shell

  • Try This command :-

    git --version


    Congratulations, you have verified your Git version.

Explore Help

git -h

Configure your user name, email address and default Git editor

  1. Configure your user name, email address and default Git editor
git config user.name
  1. If you would like to change your user name, use
git config --global user.name "Your Name"
  1. View your current setting for your email address with
git config user.email
  1. If you would like to change your email address, use
git config --global user.email "your@email"
  1. View your current setting for default Git editor with
git config core.editor

Congratulations, you have configured your user name, email address and default editor

Create a Local Repository

Create a repos directory for all your local repositories

mkdir Project
cd Project

initialize a repository.

git init

//OUTPUT//
Initialized empty Git repository in Project/.git/

Congratulations. You have created a local repository

Commit to a Local Repository

View file status using

git status
  • This command It used to see the file and dir status

  • In a command line, navigate to your "Project" directory and execute git status . You should see the message "Nothing to commit"

  • Execute git status . You should see that Git notices the fileA.txt file and identifies it as untracked.

Stage content

git add  " <file name> // or // < . > "

file name -> FileName File on Working Tree
< . > -> all File on Working Tree

Commit content

  • Git manages versions of projects

  • Each Version of a project is called a commit (eg)

  • Each commit is a sanpshot the entire project

    git commit -m "<commit Statement>"

    -m is used to add a Commit statement or message

View the commit history using git log

  • You should see your commit details, including your commit message

    git log
    • Execute git log --oneline . A concise version of the history is displayed

Congratulations. You have staged a file and created a commit