Get Started with "Git"
Use the top right "Search" to find a command or action (e.g. "log" or "differences"). To show examples use the (1) icon.
- Examples
git <command>
Basic Commands
Initialize new repository (1)
- Examples
git init
no parameter to initialize the current directory
git init /temp/somedir
use for to initialize a specific directory
git init
Or clone existing repository. (1)
- Examples
git clone /path/to/git-repository.git
git clone https://github.com/rainan16/PVmeter.git
git clone <repository>
Stage all changes in <directory>
or <file>
for next commit. (1)
- Examples
git add .
git add some_file.md
git add <directory_or_file>
Commit your staged content as a new commit with a descriptive message <msg>
. (1)
- Examples
git commit -m"initial commit"
Option-a
automatically stages changes:
git commit -am"some other commit"
git commit -m "<msg>"
Show changes in your working directory. (1)
- Examples
git status
git status --oneline
non-verbose format
git status
Display commit history. (1)
- Examples
git log
git log --oneline
non-verbose format
git log --graph
graphical format
git log
Show unstages changes in your working directory. (1)
- Examples
git diff
git diff <file_name>
diff only one file
git diff