-
'git init' : Initialize current folder as a git repository.
-
'git clone : brings the git repo from to current folder
-
'git status: tells us what we need to know about our repository.
-
'git add : adds to the staging area
-
'git commit: open a text editor to write commit message
-
'git commit -m "message" : write message as a commit without a text editor
-
'git log' : shows the log (histroy) of our commits -git log --oneline : shows the shorter online commit
-
'git diff' : compare current uncommitted state with last known git state
- 'git diff --staged : runs git diff between the staging area and last known state
- 'git diff HEAD~ . compares HEAD with commit ago
-
'git diff ': compares head with the commit in
-
'git restore --source : retore file to
-
'git checkout restores file to
- git checkout if you forget the file you end up in detach
- git chekcout main : go back to main
- git switch main : go back to main
- 'git remote add ': add the as a remote with the name
- is by convention called 'origin'
'git remote rm removes the remote called
'git remote -v' : look at all the remotes you have 'git push : pushes the branch to
- is by convention called 'origin'
'git remote rm removes the remote called
-
'git pull ' : pull the branch in to local computer.