Skip to content

MrPrakashR/Learn-Git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learn-Git

Learning git

Git Command Helper

  1. git —version
    • To Check git installed with what version.
  2. git config —global user.name "Prakash"
    • To identify committer name, we can set using this command.
  3. git config —global user.email "prakash@test.com"
    • To identify committer email, we can set using this command.
  4. git config —global user.email
    • To get who using this git setup, there email id.
  5. git config —global —edit
    • Edit email and name using editor.
  6. git init
    • To make empty repository.
  7. ls -a
    • To see .git file or hidden file
  8. git status
    • To check which all new file added or removed and which all file in commit or staged area.

Staging Area : cache area or before committing area.

working directory

  1. git add filename.java
    • To add file to staging area
  2. git commit -m “message”
    • To move code to committing area, from staging area.
  3. git log
    • Log of all commit and each commit will have unique hash identifier.
    • It also tell who committed when and what file
    • It also tell committed root or current head
  • O/P:

    • commit 0773566c516cc82baafcdd33f3a8cf350a696d68 (HEAD -> master)
    • Author: Prakash prakash@test.com
    • Date: Sun Oct 2 12:07:22 2021

    initial commit

  1. Fish tool. * Help in autosuggestion for git command.
  2. git checkout hashcode/master/branch
    • Help in switch between committees.
    • Switch between branches
  3. git branch
    • To see all branches
    • To see current working branch

Develop

  1. git branch branchName
    • To create new branch
  2. git checkout -b branchName * Checkout with creating new branch
  3. git merge prakash/multiply * merger updated prakash/multiply to current dev branch
  4. touch .gitignore
    • Help hiding file from git ecosystem and will not show in git status.
    • Just add file name in this file
    • To see hidden folder in Mac : Command + Shift + .
  5. git remove add origin remote_repository_name
    • To connect with remote GitHub repository
  6. it remote -v
    • To view remote repository name
  7. git clone github_remote_repository_name
    • To clone or download repository on your device.

About

Learning git

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages