Git command cheatsheet November 27, 2023 admin Git command 0 Spread the love Configuring Git git config –global user.name “Your Name”git config –global user.email “[email protected]” Basic Git Commands git statusgit add <file_name>git add .git commit -m “Your commit message here” Branching and Merging git branch <branch_name>git checkout <branch_name>git switch <branch_name>git checkout -b <branch_name>git merge <branch_name> Remote Repositories (GitHub) git remote add origin <repository_url>git push -u origin <branch_name>git pull origin <branch_name> Viewing History and Diffs git loggit show <commit_hash>git diffgit diff HEAD Undoing Changes git checkout — <file_name>git reset HEAD~1 Gitignore # Remove all text files*.txt# Remove a folder/foldername Creating and Cloning Repositories git initgit clone <repository_url> GitHub Workflow Fork the repository on GitHub.Clone your fork to your local machine.Add the original repository as a remote.Create a new branch for your changes.Make and commit changes in the new branch.Push the changes to your fork.Create a pull request on the original repository.Discuss and review changes with collaborators.Merge the pull request into the main branch.