Basic git commands

This article is more like git basic commands cheat sheet. don't from it explain you about those commands and git GitHub.

  • git config

 git config --global user.name "Your name"
 git config --global user.email"Your email"

this commands are important to do. This information that we are giving above will be display on your commit.

  • git status

It tells about status of files or folder. If anything updated and we run this command it will tell us which file is update by saying it is modified , if removed then it will tell that, if new file added it will tell that to.

git status
  • git init

  git init

it initializes an empty git repository. You have to run this command first to use git to track your progress and to other stuff with that repository or folder.

  • git add .

git add .

this command will add all files in your folder to staging area.

what's staging area? consider it as our files are ready for taking photo.

-## git commit

  git commit -m 'initial commit'

As I said earlier we move files to staging area by git git add .

now we did commit means we took snapshot of our files.

Now we are ready to push it our GitHub

  • git remote

    git remote add origin originUrihere
    

    at above code you have to paste at originUrihere your github repo link. where you want to push it.

. mean we are saying add all files to staging area.

  • git push

git push origin master

by above command you are pushing all your commited files to your GitHub repo.

make sure that you allowed your PC to push to your GitHub

you can do it either by SSH key method or giving access token(you can search about that because this article is only about git basic commands)

`