Published Apr 18, 2024
This is a basic guide to some common Git commands.
Setup
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --global color.ui auto
Starting a Project
git init
git clone https://docs.github.com/articles/cloning-a-repository
Working with Changes
git status
git add [file]
git reset [file]
git diff
git diff --staged
Committing Changes
git commit -m "Your commit message here"
Changing the author for last commit
git commit --amend --reset-author --no-edit
git push --force-with-lease
Branches
git branch
git branch [branch-name]
git checkout [branch-name]
git merge [branch-name]
git branch -d [branch-name]
Remote Repositories
git fetch
git push
git pull
Viewing History
git log
For More Information
#Git #VersionControl #GitTutorial #GitCheatSheet #DevOps #Programmer #Coding #CommandLine #OpenSource #FOSS