Advertisement
Waliul

Git commands

Jan 15th, 2022
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. cd //change directory
  2.  
  3.  
  4. cd /f //change directory to F drive
  5.  
  6.  
  7. ls //shows all the files and directories of current folder
  8.  
  9.  
  10. cd programming/ //change folder
  11.  
  12.  
  13. git config --global user.name "waliul34" //config git
  14.  
  15.  
  16. git config --global user.email 00waliul00@gmail.com //config git
  17.  
  18.  
  19. git clone https://github.com/Waliul34/OurShyampur.git //downloads the files from the repository into PC
  20.  
  21.  
  22. /* start:single file upload process */
  23.  
  24. git add test.txt
  25. git status
  26. git commit -m "first commit" test.txt //this will upload test.txt from local git to github after push
  27. git push -u origin master
  28.  
  29. /* end:single file upload process */
  30.  
  31.  
  32. /* start:uploading latest version of file */
  33.  
  34. (use up button to access previous commands)
  35.  
  36. git status //it will show that test.txt file is modified
  37. git commit -m "second commit" test.txt
  38. git push -u origin master
  39.  
  40. /* end:uploading latest version of file */
  41.  
  42.  
  43.  
  44. /* start:upload the whole folder */
  45.  
  46. (right click inside the folder and click Git Bash Here)
  47. git init //initialization of git
  48. git status
  49. git add . //adds all the files in git
  50. git status
  51. git commit -m "first commit" .
  52. git branch -M master
  53. git remote add origin https://github.com/Waliul34/OurShyampur.git
  54. git push -u origin master //if shows any error : git push -f origin master
  55.  
  56. /* end:upload the whole folder */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement