From c170a993a137969d49e5a18bd6c060197af84d7a Mon Sep 17 00:00:00 2001 From: foglar Date: Mon, 7 Oct 2024 21:05:26 +0200 Subject: [PATCH] Adding updated git docs --- Development/Git/README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Development/Git/README.md b/Development/Git/README.md index f4d83d4..dbf7d47 100644 --- a/Development/Git/README.md +++ b/Development/Git/README.md @@ -10,9 +10,29 @@ - `git init` - initiallize repository - `git add README.md` - add file/s to repository - `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 - `git remote add origin https://github.com/foglar/[name].git` - add remote url - `git push origin master` - push master branch + +[Video](https://www.youtube.com/watch?v=XwWReqRfnjs)