This guide provides a collection of essential GitHub commands to enhance productivity. Master these commands and streamline your version control workflow!
-
Setting Up and Configuring Git
- Initialize a new repository with
git init
. - Configure your username and email with
git config --global
.
- Initialize a new repository with
-
Cloning and Creating Repositories
- Clone a repository with
git clone <repository-url>
. - Create a new repository with
git init <repository-name>
.
- Clone a repository with
-
Basic Workflow Commands
- Check the status of your repository with
git status
. - Stage and commit changes using
git add
andgit commit
.
- Check the status of your repository with
-
Branching and Merging
- Create and switch to branches with
git branch
andgit checkout
.
- Create and switch to branches with
-
Handling Changes and Updates
- View commit history with
git log
. - Revert and reset changes using
git revert
andgit reset
.
- View commit history with
-
Collaborating with Others
- Fork repositories and submit pull requests on GitHub.
- Fetch updates from upstream with
git fetch upstream
.
- Use
git help <command>
for more information on any command. - Keep your commits atomic and descriptive for an organized history.