Hi Guest 1 HomePage 1 Jobs 1 WalkIn 1Articles  

 :) Latest Topic
Git Tutorial
What is Git?
Features of Git
Benefits of Git
Why use Git?
GitHub Introduction
GitHub Features
GitHub Benefits
Git vs GitHub
Git vs SVN
Git vs Mercurial
Version Control System
Distributed Version Control
Install Git on Windows
Install Git on Linux
Install Git on MAC
Git Environment Setup
Git configuration levels
Git Tools
Git Third Party Tools
Git Terminology Part1
Git Terminology Part2
Git Commands Part1
Git Commands Part2
Git Commands Part3
Git Cheat Sheet
 


  

 
Git Commands Part2
Question Posted on 10 Jul 2023

Home >> Tutorial >> Git Tutorial >> Git Commands Part2


Git Commands Part2
Below are the 12 most essential Git command that we used on daily basis are explain below:-


(1)Git Config Command
We use command to configures the user. And when we say about the Git config command it is first and necessary command which is used on the Git command line. And this commands mainly sets the author name and email address which is used with your commits. And we can also used Git config in other cenarios too.

Syntax

$ git config --global user.name "crackYourInterview"
$ git config --global user.email "crackyourinterview2018@gmail.com"




(2)Git init command
We use this command to create a local repository.

Syntax

$ git init testDemo

When we say about the init command this will initialize an empty repository. And below is the screenshot when we run above commands








(3)Git clone command
We used this command to make a copy of a repository from an existing URL. And if you need a copy of any repository from GitHub, and this command allows creating a local copy of that repository on your local directory from the repository URL.

Syntax

$ git clone URL






(4)Git add command
We use this command to add one or more files to staging area(the Index).

Syntax
To add one file we use below command

$ git add Filename

And to add more than one file we use below commands

$ git add*






(5)Git commit Command
When we say about the Commit command in Git we used in two scenarios. And these are given below and syntax for this is given below

$ git commit -m

When we use above command this command will changes the head. It records or snapshots the file permanently in the version history with a message.

Syntax

$ git commit -m " Commit Message"

$ git commit -a

This command commits any files added in the repository with git add and also commits any files you've changed since then.

Syntax

$ git commit -a






(6)Git status Command
We use status command to display the state of the working directory and the staging area. This allows to see which changes have been staged and which have not in and also which files are not being tracked by Git. This will not show you any information about the commited project history. And for doing this we need to use the git log. It also lists the files that you have changed and those you still need to add or commit.

Syntax

$ git status



Git Command,Git top command,Git 12 main commands,Git Daily uses command





Other Important Questions
Git Third Party Tools
What is Git?
GitHub Introduction
Features of Git
GitHub Features







 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |