These are the github commands that I started with and I would like to share the same with you.

  • git init -> to initialize a github repository
  • git add . -> adds all the files to be committed
  • git commit -m "the reason of the commit" -commits the files ready to be pushed
  • git push -u origin branch_name -> pushes the files to the repository

Ignore hidden files

.*
!/.gitignore

[1]

Advanced commands - Don’t attempt these, if you are a git beginner

git rm -r --cached . -> This removes the index but the files resides on the local disk. It is important when you add files in .gitignore and is not updated. [2]

git clone -b <branchname> <remote-repo-url> -> to clone from a specific branch

References

1 2