- cd project_directory
- touch file
- create readme.md file
- fill readme
- git add .
- git status
- git commit -m "first commit"
- if tour account doesn`t have a public key then
generate ssh-key ssh-keygen -t ed25519 -C "message" || ssh-keygen -t rsa -b 4096 -C - Connect github with repo by ssh (copy cat ~/.ssh/id_rsa.pub)
- Check key - ssh -T git@github.com
- if you already have key then (copy ssh in repo site) git remote add origin git@github.com:%ИМЯ_АККАУНТА%/first-project.git
- Check connection between repo and github git remote -v
- first commit - git push -u origin master
- Other commits git push
git log --oneline // print last log
your last hash stored in ~/.git file
git statuses - untracked/staged/modified/tracked
- after create file his is untracked
- after git add file gis is staged && tracked(git track his modifies (differ between his and his in repo))
- after change some data in the file, his have status a modified && tracked
- in git status your will see 2 snapshots of the file (1- staged, 2 - modified)
- git add file again. And the file have status staged. In git status you will see only 1 snapshot
- after git commit. All staged files will be commited on the repo.
- git push transmit the commit on the remote storage.