Git, a version control system, is the go-to tool for developers everywhere. In this quick guide, let’s cover some basic commands that every developer should know.
→ Initializes a new Git repository
→ Adds files to the staging area.
→ Undo the changes to the local files, and restore to the last commit.
→ Displays the difference between files in two commits or between a commit and your current repository.
→ Used to view the entire commit history.
git commit -m “message”
→ Used to commit files (locally) on the repository.
→ Used to download existing code from a remote respository.
→ Used to list all the local branches on the machine.
→ Used to create a new branch locally.
git branch -d
→ Used to delete a branch.
git branch -m
→ Used to rename the current working branch.
→ Merges the provided branch with the current working branch.
→ Used to switch from current branch to another one.
git checkout -b
→ Creates a new branch and switches to the new one.
→ Used to save all commits to the remote repository.
→ Used to pull down all the updates rom the remote repository.
→ Used to remove a file from the working directory.
→ Used to temporarily remove uncommitted changes.