Git
General
q
|
Exit |
git status
|
Show unstaged changed files |
git diff
|
Show changes in files |
git restore .
|
Discard all unadded changes |
git log
|
Show past commits |
git log --oneline
|
Show past commits, each in one line |
git branch -a
|
Show all branches including remote ones |
Settings
git config --global core.autocrlf input
|
Convert CRLF line endings to LF on commit |
git config --global core.autocrlf true/false
|
Convert LF line endings to CRLF on commit or don't convert at all |
Initialization
git init
|
Create local repository (hidden .git folder) |
git add .
|
Stage all content for the first commit |
git commit -m "init"
|
Commit content with the message "init" |
Synchronization
git commit -a -m
|
Commit while automatically staging all changed (but not new) files |
git push
|
Push all local commits to the remote repository |
git push -f
|
Pushing local commits forced (when you really don't want to pull first). |
git pull
|
Pull and integrate all remote commits to the local respository |
git fetch
|
Download a remote repository without commiting to the local repository |
git clone
|
Get a copy of the remote repository |
git checkout -b [branch]
|
Create a new branch and change to it |
git checkout [branch]
|
Change the current branch |
git merge
|
Merge the remote and the local commits |
PowerShell
General
clear
|
Clear the display |
Ctrl + C
|
Exit |
File structure
ls
|
List the content of the working directory |
cd
|
Change the working directory |
code . -r
|
Open working directory reusing VSCode window |
md
|
Create (make) a directory |
ni
|
Create a file (new item) |
gc
|
Show (get) the content of a file |
gc -head n
|
Show (get) the n first lines of content of a file |
gc -tail n
|
Show (get) the n last lines of content of a file |
mv
|
Move or rename a file or directory |
rm
|
Remove a file or directory |