Revision Date Edited by Changes Status
1 2022-12-27 05:13:06.723503 Bruce 156++ OK View
0 2022-12-27 03:14:03.141828 Bruce 913++ OK View

History Date: 2022-12-27 03:14:03.141828
Edited by: Bruce

Basic Git Commands
 Here is a list of some basic Git commands to get you going with Git.

||Git commands|Notes|
|config| git config --global user.name "Bruce Smith"
git config --global user.email bruce\@example.com ||
|check out a repo| git clone https://github.com/path/to/repo.git ||
|Add files|git add .||
|commit| git commit -m 'commit message' ||
|push| git push origin main||
|switch branch| git checkout branch_name||
|create a branch and checkout| git checkout -b branch_name||
|update from remote repo|git pull||
|merge from a branch into your current branch|git merge branch_name||
|sync with upstream and rebase|git pull upstream main --rebase||
|preview changes|git diff||
|undo local changes|git checkout -- file_name| discard your local changes in this file and override with last content in head|
|discard all local changes|git fetch origin
git reset --hard origin/main||
Displays the changes in this historical version, green text indicates the content added; red strikethrough text indicates the content deleted.
Back to note