Getting started with Git

Getting started with Git

Table of contents

No heading

No headings in the article.

Git is the free and open source distributed version control system that's responsible for everything GitHub related that happens locally on your computer

Some IMP Git commands:

  1. • ls : show me the all list of files and folders inside the directory.
  2. • ls -a : show me the all hidden files inside the folder
  3. • mkdir : make directory : to create new folder in specified location.
  4. • cd : change directory : to go inside the folder & to change its location.
  5. • git init : to initialized a empty git repository to a specific folder.
  6. • git status : to see the status for what we make changes priviously.
  7. • git add . : add the changes in history for furthur view
  8. • git commit -m "message" : commit the changes that you made with any message
  9. • touch file name : to create new file (touch names.txt)
  10. • vi file name : to go inside any file and change what you want.
  11. • esc :wq = to get outside from vi editor
  12. • git log : to see the whole log i.e. All changes that you made.
  13. • git reset id of the commit (get from git log) : to unstage the changes you made priviously
  14. • cat names.txt(file name) : to see the content from the file
  15. • git stash : supposed you made some changes but dont want to add now , save & insert them into backstage
  16. • git stash pop : to see the changes to be commited
  17. • git stash clear : clear the commits
  18. • git remote add origin URL : initialize the origin branch with URL
  19. • git push origin master : push the changes you made to the main branch
  1. • BRANCH & MERGE
  2. • git branch : to see list of branches present at movement
  3. • git branch branchName : to create new branch
  4. • git checkout branchName : points to head of the branch
  5. • git push origin branchname : push the changes to your branch