AlaminSakib

Github basics

Feb 28th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. 1. go to folder where u want to initialize git
  2.  
  3. 2. right click and open 'git bash here'
  4.  
  5. 3. 'git init'
  6. //a hidden .git file will be created and git will be setup there
  7.  
  8. 4. git status //to check which files were tracked or not
  9.  
  10. 5. git add . //add all files to git
  11.  
  12. 6. git commit -am "sadsad" //comment what changes u did and save the changes
  13.  
  14. 7. clear //to clear screen
  15.  
  16. 8. git log // to view all changes that were made
  17.  
  18. 9. git show lognumber // to view what changes u made during a commit
  19.  
  20. 10. git checkout lognumber // to change code to a specific commit
  21. ctrl + z to end
  22.  
  23. 11. git checkout master // to change code to the recent version
  24.  
  25. 12. git remote add origin url //to link ur local changes to created repository for the first time
  26.  
  27. 13. git push origin master // to push ur changes to repository
  28.  
  29. 14. git pull origin master // to download ur repository to someplace. u can change and modify then update online using push
  30.  
  31. 15. git clone url //to clone a repo but u cant update the repo
  32.  
  33. 16. add new user
  34. git config --local credential.helper ""
  35. git config user.name her_username
  36. git config user.email her_email
Add Comment
Please, Sign In to add comment