You are on page 1of 2

Githud : it is an open source and any one can use it free of cost.

Remote Repository: it is simply called as repo. it is project folder/package.

Local Repository: it is project in the local machine like our lpatop/desktop.

Staging Area:

Working Directory:

-------------------------------------------------------------------
Some imp commands:

1. to set user name and email

git config --global user.name "ImDwivedi1"


git config --global user.email "Himanshudubey481@gmail.com"

---------------------------------------------------------------------------

2. This command is used to create a local repository.

git init Demo

--------------------------------------------------------

3. The status command is used to display the state of the working directory and the
staging area.

git status

----------------------------------------------------------------

4. This command is used to add one or more files to staging (Index) area.

-> To add one file ( git add Filename )

-> To add more than one file ( git add* )

----------------------------------------------------------------

5. Commit command is used in two scenarios. They are as follows.

git commit -m " Commit Message"

git commit -a -m "hi i commited"

------------------------------------------------------------

6. to see the number of commits

git log

-------------------------------------------------------

7. to check the current branch..it will show on which branch u r...like


master/main/develop

git branch
-----------------------------------------------------------

8. to push the code into branch

git push -u origin main

---------------------------------------------------

9. to clone the project from github

git clone URL

-------------------------------------------------

BRANCH:
----------

-> will create one our own branch ..then will do commit and push to that branch
from there will rise PR(pull request) to merge into master/main branch.

how to create branch:


--------------

git checkout -b "demo"

You might also like