Essential GIT Commands for Software Developers.

I sense your interest in becoming a software engineer. In that case, it’s crucial to familiarize yourself with the following Git commands.
Before delving into the details, take a moment to imagine a scenario:
Your repository consists of two branches, named ‘a’ &‘b’.
Main Three States:
- Working Directory:
git status
: Check the status of your working directory and see which files are modified.
- Staging Area:
git add <file>
: Stage changes in the specified file for the next commit.git add .
orgit add -A
: Stage all changes in the working directory.
- Repository:
git commit -m "Your commit message"
: Commit staged changes to the repository.
Git Stashing:
- Stash Changes:
git stash save "Your stash message"
: Save your changes to a stash.
- List Stashes:
git stash list
: View a list of your stashes.
- Apply Stash:
git stash apply
: Apply the latest stash.git stash apply stash@{2}
: Apply a specific stash.
- Pop Stash:
git stash pop
: Apply the latest stash and remove it from the stash list.
- Drop Stash:
git stash drop stash@{2}
: Discard a specific stash.
- Clear All Stashes:
git stash clear
: Remove all stashes.
Git Rebase:
- Rebase Interactive:
git rebase -i <branch>
: Start an interactive rebase on the specified branch.
- Continue Rebase:
- After resolving conflicts during a rebase:
git add <conflicted-file>
: Stage the resolved file.git rebase --continue
: Continue with the rebase.
- Abort Rebase:
git rebase --abort
: Abort the ongoing rebase.