Have you ever been stucked while using git🤔? If your answer is yes, This article is for you. You dont need to memorize all of git command. Here is a cheat sheet that will simply your life.
Git is a free, open-source version control software. It was created by Linus Torvalds in 2005.
Therefore, Git is essentially a content tracker. Git can therefore be used to store content; however, due to its other features, it is primarily used to store code.
Initialze a local repository:
git init <directory>
Set configuration value for your usernmae and email:
git config --global user.name <your name>
git config --global user.email <your email>
Clone a repository:
git clone <repository-url>
Add a file to the staging area:
git add <file>
Add all files changes to the staging area:
git add .
Check the unstaged changes:
Commit the staged changes:
git commit -m "Your Message"
Add changes made to track files and commit:
git commit -a -m "Your Message"
Reset staging area from last commit:
git reset <file>
Check the status of the working directory:
Remove a file from the index and working directory
git rm <file>
List the commit history:
To display branches:
To create a branch:
git branch <branch name>
To switch to a branch:
git checkout <branch name>
To delete a branch:
git branch -d <branch name>
To merge a branch:
git merge <branch name>
Pull changes from a remote repository:
git pull <remote name>
Push changes to a remote repository:
git push <remote name>
Git is used for source code management. It is a free and open-source version control system used to handle small to very large projects efficiently. Git is used to tracking changes in the source code, enabling multiple developers to work together on non-linear development.