Git Commands
๐ git init โ Initialize a new Git repository
๐ฅ git clone <repo> โ Clone a repository
๐ git status โ Check the status of your repository
โ git add <file> โ Add a file to the staging area
๐ git commit -m "message" โ Commit changes with a message
๐ git push โ Push changes to a remote repository
โฌ๏ธ git pull โ Fetch and merge changes from a remote repository
Branching
๐ git branch โ List all branches
๐ฑ git branch <name> โ Create a new branch
๐ git checkout <branch> โ Switch to a branch
๐ git merge <branch> โ Merge a branch into the current branch
โก๏ธ git rebase <branch> โ Apply commits on top of another branch
Undo & Fix Mistakes
โช git reset --soft HEAD~1 โ Undo the last commit but keep changes
โ git reset --hard HEAD~1 โ Undo the last commit and discard changes
๐ git revert <commit> โ Create a new commit that undoes a specific commit
Logs & History
๐ git log โ Show commit history
๐ git log --oneline --graph --all โ View commit history in a simple graph
Stashing
๐ฅ git stash โ Save changes without committing
๐ญ git stash pop โ Apply stashed changes and remove them from stash
Remote & Collaboration
๐ git remote -v โ View remote repositories
๐ก git fetch โ Fetch changes without merging
๐ต๏ธ git diff โ Compare changes
Donโt forget to react โค๏ธ if youโd like to see more content like this!
Post #2521
4.54K
- โค 14
- ๐ 1
- ๐ 1