Common Git Commands and what they do
Odipo Otieno (KwargDevs)
Posted on January 24, 2023
-
git init
: Initializes a new Git repository. -
git clone
: Creates a copy of a remote repository on your local machine. -
git add
: Adds changes to the staging area, in preparation for a commit. -
git commit
: Creates a new commit with the changes in the staging area. -
git status
: Shows the status of the working directory, including changes that have been made but not yet committed. -
git log
: Shows a log of all commits in the repository. -
git diff
: Shows the differences between the working directory and the last commit. -
git branch
: Shows a list of branches in the repository and indicates the current branch. -
git checkout
: Allows you to switch between branches or restore files in your working directory to a specific commit. -
git merge
: Merges changes from one branch into another. -
git pull
: Fetches and merges changes from a remote repository into your local repository. -
git push
: Pushes commits from your local repository to a remote repository.
💖 💪 🙅 🚩
Odipo Otieno (KwargDevs)
Posted on January 24, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.