Adding updated git docs
This commit is contained in:
parent
2c59996146
commit
c170a993a1
@ -10,9 +10,29 @@
|
|||||||
- `git init` - initiallize repository
|
- `git init` - initiallize repository
|
||||||
- `git add README.md` - add file/s to repository
|
- `git add README.md` - add file/s to repository
|
||||||
- `git commit -m "first commit"` - commit file
|
- `git commit -m "first commit"` - commit file
|
||||||
- `git branch -M main`
|
- `git branch -M main` - switch branch to main
|
||||||
|
|
||||||
|
## Information
|
||||||
|
|
||||||
|
- `git status` - view current files status
|
||||||
|
|
||||||
|
## Repository changes
|
||||||
|
|
||||||
|
- `git reset HEAD~1` - revert to previous commit
|
||||||
|
- `git reset --hard` - goes to the previous commit and removes all changes
|
||||||
|
|
||||||
|
## Branches
|
||||||
|
|
||||||
|
- `git branch [name]` - create new branch
|
||||||
|
- `git checkout [name]` - switch to it
|
||||||
|
|
||||||
|
## Git merge and rebase
|
||||||
|
|
||||||
|
- ``
|
||||||
|
|
||||||
## Remote repository push
|
## Remote repository push
|
||||||
|
|
||||||
- `git remote add origin https://github.com/foglar/[name].git` - add remote url
|
- `git remote add origin https://github.com/foglar/[name].git` - add remote url
|
||||||
- `git push origin master` - push master branch
|
- `git push origin master` - push master branch
|
||||||
|
|
||||||
|
[Video](https://www.youtube.com/watch?v=XwWReqRfnjs)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user