What is Git and GitHub their all Command

Sandipan Kr Bag Apr 03, 2024
What is Git and GitHub their all Command

What is Git and GitHub ?

Git is a distributed version control system (DVCS) that tracks changes in source code. GitHub is a web-based hosting service for Git repositories, offering collaboration tools like issue tracking and pull requests. Git enables efficient code management locally, while GitHub facilitates remote collaboration and project hosting with additional features.Developers use Git locally and GitHub for remote collaboration, sharing code, and hosting projects online.

All Command  of Git : 

  1. git init: Initialize a new Git repository. Example: git init
  2. Set user name: Configure the user name globally. Example : git config --global user.name "Your Name"
  3. Set user email: Configure the user email globally. Example : git config --global user.email "your_email@example.com"
  4. Get user name: Retrieve the configured user name. Example: git config --global user.name
  5. Get user email: Retrieve the configured email address. Example: git config --global user.email
  6. List all global configurations: List all global Git configurations. Example : git config --global --list
  7. To stage from the working directory : git add --all
  8. To stage from the working directory : git add -A
  9. All files in the directory will be staged but other files will not be staged - git add .
  10.  How to return working Directory from staged all file - git reset 
  11. To unstage a specific file: git reset file_name
  12.   How to return working Directory from staged file in a Single -  git  rm --cached file_name
  13. command used in Git to show the changes - git diff
  14. This command discards changes in the specified file - git checkout file_name
  15. Discards changes in the working directory for the specified file - git restore file_name
  16. If you have untracked files in your Git repository and you want to remove them, you can use the following Git command- git clean -f





     




     

Share this article

sndp bag

Sandipan Kr Bag

I'm a dedicated full-stack developer, entrepreneur, and the proud owner of ocec.org.in , hailing from the vibrant country of India. My passion lies in creating informative tutorials and sharing valuable tips that empower fellow artisans in their journey. With a deep-rooted love for technology, I've been an ardent enthusiast of PHP, Laravel, Angular, Vue, Node, JavaScript, jQuery, Codeigniter, and Bootstrap from their earliest days. My philosophy revolves around the values of hard work and unwavering consistency, driving me to continuously explore, create, and share my knowledge with the tech community.

* Hire Me

0 Comments

Load more Comments

Post a Comment

Hint: Please enter between 80 - 300 characters.
ocec.org.in

helllo