Here are 12 commonly used Git commands:
git init
- Initialize a Git repository in the current directory.git clone <repository>
- Clone an existing repository from a remote location to your local machine.git add <file>
- Stage a file for commit.git commit -m "message"
- Commit the staged changes with a message describing the changes.git status
- Check the status of the repository and see which files have changes that have not been committed.git diff
- View the differences between the current state of the files in the repository and the last committed version.git log
- View the commit history of the repository.git branch <branch-name>
- Create a new branch.git checkout <branch-name>
- Switch to a different branch.git merge <branch-name>
- Merge changes from a specified branch into the current branch.git push <remote> <branch-name>
- Push local changes to a remote repository.git pull <remote> <branch-name>
- Pull changes from a remote repository and merge them into the local branch.
These are just a few of the most commonly used Git commands, and there are many more to learn. It is a powerful tool that is widely used by developers and organizations to manage code and collaborate on software projects.