siddharth963

Adding files for first time in github

Aug 24th, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. If you are going to upload your project folder this is from starting stepwise.
  2.  
  3. 1) Go to github and create a new repo
  4. 2) copy the "clone with HTTPS" link"
  5. (now i think you should run git init to create .gitignore file but I'll tell it
  6. how to do in another way)
  7. 3) cd to your project folder and run :
  8.  
  9. => git clone <link>
  10.  
  11. 4) always do git pull first
  12. => git pull
  13.  
  14. 5) now to create .gitignore (ONLY if not created automatically) which ignores the foler mentioned in that file,
  15. we use the following code to ignore node_modules files (you need to ignore your
  16. specific big files according to your project)
  17.  
  18. =>touch .gitignore && echo "node_modules/" >> .gitignore && git rm -r --cached node_modules ; git status
  19.  
  20. 6) then run =>git status to check any warnings
  21.  
  22. 7) then do
  23. =>git add .
  24. (you may git warnings-> LF to CRLF conversion , check on the net,
  25. I had previoulsy got those warnings when I did git add . before I added .gitignore
  26. but after adding idk how the warnings resolved)
  27.  
  28. 8) then just check for git status
  29.  
  30. 9) continue with
  31. =>git commit -m "<description>"
  32. =>git push
  33.  
  34. 10) Run git status whenever you want to ckeck what's going on.
  35.  
  36. 11) done
  37. ______________________
  38. to update the changes made to the files,run
  39. git add .
  40. git commit -m"description"
  41. git push
  42.  
Add Comment
Please, Sign In to add comment