Getting Started with git: A Beginner Guide
Jun 1, 2025 • NinjaFunction Team
GitGit Commandgit-cmd
Oficial Website: www.git-scm.com
Documentation: https://git-scm.com/doc

Introduction
Git is a powerful version control system that helps developers manage codebases, track changes, and collaborate effectively. Below is a table of essential Git commands, followed by a summary of each to help you understand their purpose and usage.
Git Commands
Command | Summary | Syntax | Example |
---|---|---|---|
config | Get and set repository or global options. | git config [options] [key] [value] | git config --global ninjafunction "Ninja Function" |
clone | Clone a repository into a new directory. | git clone [url] [directory] | git clone https://github.com/user/ninjafunction.git |
status | Show the working tree status. | git status [options] | git status |
diff | Show changes between commits, commit and working tree, etc. | git diff [options] [<commit>] -- [<path>...] | git diff |
commit | Record changes to the repository. | git commit [options] [--] <pathspec>... | git commit -m "Added new feature to ninjafunction" |
notes | Add or inspect object notes. | git notes [command] [options] | git notes add -m "Note for commit" abc123 |
restore | Restore working tree files. | git restore [options] [--] <pathspec>... | git restore --staged file.txt |
reset | Reset current HEAD to the specified state. | git reset [options] [<tree-ish>] | git reset HEAD~1 |
rm | Remove files from the working tree and from the index. | git rm [options] [--] <filepattern>... | git rm file.txt |
mv | Move or rename a file, a directory, or a symlink. | git mv <source> <destination> | git mv file1.txt file2.txt |
branch | List, create, or delete branches. | git branch [options] [<branchname>] | git branch feature/new-feature |
checkout | Switch branches or restore working tree files. | git checkout [options] <branch> | git checkout feature/new-feature |
switch | Switch branches. | git switch [options] <branch> | git switch feature/new-feature |
merge | Join two or more development histories together. | git merge [options] [<commit>...] | git merge feature/new-feature |
mergetool | Run merge conflict resolution tools to resolve merge conflicts. | git mergetool [options] [<file>...] | git mergetool |
log | Show commit logs. | git log [options] [<revision-range>] [[--] <path>...] | git log --oneline |
stash | Stash the changes in a dirty working directory away. | git stash [command] [options] | git stash save "WIP" |