Git

Last Updated: 7/12/2023

Initialize a Repository

  • The first time we want to add a file to a git repository, we have to initialize a new empty repository.
git init

.git subdirectory

  • A new subdirectory .git is created and by default it is hidden because you're not supposed to touch it.
  • This is where Git stores information about our project history.
  • If you corrupt or remove this directory, you will lose your project history.

Git Bash Command

Change drive

cd d:

Change directory

cd /d/ganesh/samples

Create directory

mkdir git-demo
cd git-demo

List all files

ls

List all files including hidden

ls -a

Remove directory

rm -rf .git

Reference: