- Git is a popular version control system.
- Over 70% of developers use Git!
- Git is used to collaborate on code.
git-cli |
doc |
$ pwd |
check the current working directory |
$ ps |
-- |
$ cd |
change the current working directory. (TAB-KEY-Press) |
$ cd .. |
back directory |
$ cd \ |
root directory |
$ ls |
check your folder and file |
$ ls -a |
-- |
$ ls -l |
-- |
$ ls -la |
-- |
$ ls -i |
-- |
$ chmod |
-- |
$ mkdir (folder-name) |
make directory |
$ rmdir (folder-name) |
delete a directory |
$ touch (file-name) |
create the file with content |
$ cat (file-name) |
read a file |
$ start (file-name) |
open any browser txt,html,file etc command ($ start chrome git-document.txt) |
$ start code |
open VS code |
$ clear |
clear type and press enter (command clear) |
$ composer init
$ git config --global user.name {your-name}
$ git config --global user.email {your-email}
$ git config --global package.name {your-package-name}
$ git config --global package.type {your-package-type}
$ git config --global license.name {your-package-license}
Github - (Using Git with GitHub)
- Git is not the same as GitHub.
- GitHub makes tools that use Git.
- GitHub is the largest host of source code in the world
github-cli |
doc |
$ git --version |
-- |
$ git status |
show the current status of the working tree |
$ git echo "# Github Tutorial" >> README.md |
create README.md file |
$ git init |
-- |
$ git add README.md |
single file add |
$ git add --all |
add all the files |
$ git add -A |
add all the files |
$ git add . |
add all the files |
$ git commit -m "First commit" |
save your files in git |
$ git branch -M (branches-name) |
main or another-branches |
$ git remote add origin (HTTPS-Link) |
track your files and changes in git |
$ git push -u origin (branches-name) |
upload git commits to a remote repo, like Github. (main or another-branches) |