Runs fetch + merge silently. Creates a hidden merge commit on your branch. The #1 cause of messy histories.
Use this instead:
git fetch then git rebase origin/develop
VS Code "Sync Changes" button
Does pull + push in one click silently. You cannot see what it does before it does it.
Use this instead:
Open terminal (Ctrl+`) and run every step manually
VS Code Pull button (down arrow)
Identical to git pull. Creates a hidden merge commit.
Use this instead:
git fetch then git rebase origin/develop
git reset --soft on a shared branch + git add .
Un-commits everything including teammates work into your working directory. One wrong git add . and you commit someone elses code as your own.
Use this instead:
git rebase -i HEAD~N -- only touches your own commits
git push --force
Overwrites remote with no safety check. Can silently delete teammates commits.
Use this instead:
git push --force-with-lease
git reset --hard
Permanently deletes all uncommitted file changes. No undo possible.
Use this instead:
git stash -- saves everything, restore anytime with git stash pop
VS Code "Discard All Changes"
Same as git reset --hard. Permanently wipes all uncommitted work instantly.
Use this instead:
git stash -- or right-click individual files and discard only those
IDE -- what is safe and what is not
Safe to use
Stage file (+) -- click + next to individual files only, never "Stage All"
Commit button -- same as git commit
Merge conflict editor -- 3-way conflict resolver
Discard single file -- right-click one file only
Branch switcher -- bottom-left VS Code, Git panel IntelliJ
Never click
Sync Changes -- pull + push silently
Pull button (down arrow) -- hidden merge commit
Push button after rebase -- use terminal with --force-with-lease
Discard All Changes -- permanent, use git stash
Stage All after soft reset -- stages everyones files
Golden pattern: Terminal (prepare) then IDE (stage your files + commit) then Terminal (push, verify).
How Git Works
Your code lives in two places. Here is what moves where and why each operation exists.
Your Computer -- private until you push
Stash
Temporary pocket. git stash saves, git stash pop restores. Nothing is lost.
up and down
Working Directory
Files you see and edit every day. Git sees changes but they are NOT saved yet.
git add yourfile.ts
Staging Area
Files marked ready to commit. Only YOUR files should be here. Run git status to verify.
git commit -m "message"
Local Repository
Saved commits on your machine. Nobody sees these until you push. Safe to experiment here freely.
Local-only operations
rebase -i HEAD~N -- squashes only YOUR commits. Count: git rev-list --count origin/develop..HEAD
rebase onto develop -- replays your 1 clean commit on top of latest develop
checkout -- switch branches locally. Nothing goes to origin.
stash -- saves uncommitted work safely. Restore with stash pop.
Sync
->
git push
--force-with-lease after rebase
<-
git fetch
safe -- changes nothing locally
BANNED
git pull
fetch + hidden merge
BANNED
Sync button
pull + push one click
Remote Repository
All branches and commits online. PRs and code reviews happen here.
Branches on origin
origin/mvp/developnever touched directly
origin/feature/your-branchpush here
origin/feature/teammatetheir branch
What happens here
Pull Requests -- code reviews, approvals
Merge to develop -- via PR button in browser only
Squash and merge -- GitHub PR merge button squashes everything
Team visibility -- everyone sees all branches and commits
You only ever push to YOUR feature branch. To accidentally push to develop you would have to explicitly type git push origin mvp/develop which we never do.
Step Guide
Pick what you want to do, fill in your details, and follow the exact steps