Skip to content
  • Facebook
GeekCer Logo

GeekCer

The geek's Coding education and Review centre

  • Home
  • Tutorials
    • Java
    • Servlet
    • JSP
    • Python
    • C Tutorial
    • Spring
    • Spring Boot
    • MongoDB
    • Hibernate
    • Data Structure
  • General Knowledge
  • Biography
  • Grammar
  • Festival (त्योहार)
  • Interview
  • Differences
  • Important
  • Toggle search form

Home » Important » Git commands with example and git log, git bash, create repo

  • Elon musk Hindi : एलन मस्क हिंदी में, Autobiography,  Net Worth
    Elon musk Hindi : एलन मस्क हिंदी में, Autobiography,  Net Worth Biography
  • Balkand Ramayana story in Hindi | रामायण बाल कांड राम का जन्म
    Balkand Ramayana story in Hindi | रामायण बाल कांड राम का जन्म Spiritual
  • Holi kyon manate hain in hindi? | Festival of colors in hindi
    Holi kyon manate hain in hindi? | Festival of colors in hindi Festival
  • Subhas Chandra Bose Biography in Hindi, Essay, Paragraph
    Subhas Chandra Bose Biography in Hindi, Essay, Paragraph Biography
  • What is Noun
    What is a Noun? 5 Types of Nouns with Examples, Noun diagram Grammar
  • Thomas Edison Biography in Hindi - थॉमस एडिसन जीवनी
    Thomas Edison Biography in Hindi – थॉमस एडिसन जीवनी Biography
  • Lata Mangeshkar Biography In Hindi | लता मंगेशकर संपूर्ण जीवन परिचय
    Lata Mangeshkar Biography In Hindi | लता मंगेशकर संपूर्ण जीवन परिचय Biography
  • States of Matter : Physical Properties of Matter (Solid, Liquid, Gas)
    States of Matter | Physical Properties of Matter (Solid, Liquid, Gas) Science

Git commands with example and git log, git bash, create repo

Posted on March 13, 2022March 13, 2022 By GeekCer Education No Comments on Git commands with example and git log, git bash, create repo
Git commands with example and git log, git bash, create repo

Git is a source code management program that can be managed by Git commands as well as Git graphical user interface tools.

If you’re a developer, you might have to use Git today. We’ll talk about commands line tools in this article. What are Git Commands, and How Do we Use Them?

Table of Contents

  • List of git commands
  • Check git version
  • SET Config Values
  • Check the config values
  • Establish a repository using existing code.
  • add command in Git
  • commit command in Git
  • diff command in Git
  • status command in Git
  • push command in Git
  • pull command in Git

List of git commands

What are Git commands? Following is the list of important git commands.

  • git add
  • git branch
  • git checkout
  • git clone
  • git commit
  • git config
  • git diff
  • git init
  • git log
  • git merge
  • git pull
  • git push
  • git remote
  • git reset
  • git rm
  • git show
  • git stash
  • git status
  • git tag

Check git version

$ git --version
git version 2.35.1.windows.2

SET Config Values

These variables are crucial since other developers need to know who is checking code in and out, making changes, and so on if you’re working with them.

As a result, this is how you may add your name to all of your check-ins and code modifications.

$ git config –global user.name “git-tutorial-525”

$ git config --global user.email "geekcer.code@gmail.com"

It’s critical to double-check that your user name and user email are both set. So, after you’ve gotten those values to work, you’re ready to go on.

Check the config values

$ git config --list

Establish a repository using existing code.

Users commonly begin using it in two situations: the first is when they have an existing project on their local system that they want to track with it, and the second is when they want to start generating whenever an existing project happens remotely.

Create a git repository from an existing directory.

$ git init

A URL may be used to retrieve a full repository from a remote repository.

git clone [url]

add command in Git

To add one or more files to the staging area, we use the add command.

git add [file]
git add *

commit command in Git

It saves (snapshots) a copy of the file in the version history and adds a message to it.

$ git commit -m "Message related to commit"  

Any files you’ve added to the repository using git add, as well as any files you’ve edited since then, are committed with this command.

$ git commit -a

diff command in Git

This command displays differences in files that haven’t been staged yet.

git diff

This command displays the difference in files that are staged but not yet committed.

git diff --staged

status command in Git

This command displays the files that have been edited in the working directory and are ready for your next commit.

git status

push command in Git

To upload the contents of local repository content to a remote repository, we use the push command.

git push [alias] [branch]

$ git push orgin master

All branches are pushed to the server repository with this command.

$ git push --all

pull command in Git

To get data from GitHub, use the pull command. It connects to the remote server and downloads and merges updates to your working directory.

$ git pull [link of repository]

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • More
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Also Read

Important Tags:Git commands cheat sheet, Git commands to push code, How many commands are there in git?

Post navigation

Previous Post: Jenkins java | Installing Jenkins on Windows
Next Post: Linux Commands With Example | Linux commands cheat sheet

More Related Articles

Ration Card and One Nation One Ration Card Scheme Ration Card and One Nation One Ration Card Scheme Important
Mockito unit testing spring boot Mockito Framework Tutorial for Unit testing | Mockito unit testing spring boot Important
Difference between Bugs, Errors and Issues in Software Testing Difference between Bugs, Errors and Issues in Software Testing Important
Maven Tutorial Maven Tutorial Important
Operational Qualification Operational Qualification (OQ) Important
How to become a Chief Financial Officer (CFO) How to become a Chief Financial Officer (CFO)? Important

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • National Farmers Day in Hindi | राष्ट्रीय किसान दिवस पर निबंध | चौधरी चरण सिंह जयंती
  • Human rights day in Hindi: 10 दिसंबर ह्यूमन राइट्स डे
  • Unicef day is celebrated on December 11 | Speech on unicef day
  • Indian Navy Day: जल सेना दिवस कब और क्यों मनाया जाता है?
  • P V Sindhu Biography in Hindi, Badminton, State, Caste पी. वी. सिंधु जीवन परिचय, कहानी, राज्य, जाति
  • Draupadi Murmu Biography In Hindi | द्रौपदी मुर्मू की जीवनी
  • Difference between Internet and Intranet
    Difference between Internet and Intranet Differences
  • Network kya hai (नेटवर्क क्या है)
    Network kya hai (नेटवर्क क्या है) Networking
  • IPv4 Vs IPv6 | Difference between IPv4 and IPv6
    IPv4 Vs IPv6 | Difference between IPv4 and IPv6 Differences
  • OSI Model | 7 Layers of OSI Model in Computer network
    OSI Model | 7 Layers of OSI Model in Computer network, Functions Networking
  • TCP/IP Model, Full Form, Layers and their Functions
    TCP/IP Model, Full Form, Layers and their Functions Networking
  • Difference between TCP and UDP
    Difference between TCP and UDP | TCP vs UDP examples Differences
  • Similarities and difference between OSI and TCP/IP model
    OSI vs TCP/IP Model, Similarities and difference between OSI and TCP/IP model Networking
  • Java Tutorial
  • Servlet Tutorial
  • JSP Tutorial
  • Maven Tutorial
  • HTML Tutorial
  • Programs
  • Hindi/English Grammar
  • Difference Between ... and ...
  • HR Interview
  • Important Articles

Write to Us:
geekcer.code@gmail.com

  • About Us
  • Privacy and Policy
  • Disclaimer
  • Contact Us
  • Sitemap

Copyright © GeekCer 2022 All Rights reserved