git config --global -e
# Opens global config file to edit username/email in vim
# Press `i` to insert, then ESC + Shift+:wq to save & quit
git config --global user.name "your_github_username"
git config --global user.email "your_email@example.com"pwd # Show current directory
ls # List files in directory
git status # Show working tree status
git add . # Stage all files
git commit -m "msg" # Commit with message (-m = message)
git remote add origin <url> # Add remote repo
git push -u origin main # Push to main branch
# Or if master is used:
git push origin mastergit merge --abort # Cancel ongoing mergefind . -type f -name "*.class" -exec git rm {} \;
# Deletes all `.class` files from repoecho "*.class" >> .gitignore # Add to .gitignore
git rm --cached "*.class" # Untrack from Gitgit ls-filesgit rm -rf folder1 # Remove folder1
git rm . # Remove all tracked files
git rm --cached file2.txt # Untrack file2.txt only
git restore --staged . # Unstage all staged filesgit branch # List branches
git branch branchname # Create a new branch
git checkout main # Switch to main
git checkout -b main1 # Create and switch to main1
git merge main1 # Merge main1 into current branch| Branch | Action | Result |
|---|---|---|
| branch1 | Add file1, file2 and commit |
Files are tracked |
| branch2 | Create file3 (untracked) |
Seen across branches |
| branch2 | Commit file3 |
Now only in branch2 |
| branch1 | Checkout again | file3 disappears |
💡 Untracked files persist across branches. Once committed, they’re tied to that specific branch.
git checkout x # Switch to target branch
git checkout a -- folder3/ # Pull only folder3 from branch a
git add folder3/ # Stage the pulled folder
git commit -m "Pulled folder3 from branch a"🧠 Only folder3/ will be pulled; other directories remain untouched.
git clone --branch branchName --single-branch https://github.com/username/repo.git➡️ Clones only branchName instead of the entire repo with all branches.
/.metadata/
back/tasksTODO.md
back/README.mdgit clean -fdX
# -f: force, -d: remove dirs, -X: ignored files onlynpx create-react-app myapp
cd myapp
npm startnpm install -g json-server # Install globally
json-server --watch data.json -p 3030 # Run server on port 3030npm i axios- Open Notepad as administrator.
- Edit this file:
C:\ProgramData\MySQL\MySQL Server 8.0\my.ini
- Change port from
3306to3030, save, and restart MySQL service.
https://open.er-api.com/v6/latest/USD
➡️ Use this endpoint to convert from USD to other currencies (no API key required).
| Step | Branch | Action Taken | Result |
|---|---|---|---|
| 1 | branch1 |
Commit file1, file2 |
Files are now tracked |
| 2 | branch2 |
Create file3 (untracked) |
Visible in both branches |
| 3 | branch2 |
Commit file3 |
Now tracked only in branch2 |
| 4 | branch1 |
Switch to branch1 |
file3 disappears (not tracked) |
for already commited so i wanted So in short:
Add to .gitignore:
backend/migrations/
If it was already committed, run:
git rm -r --cached backend/migrations git commit -m "Ignore backend migrations"
Keep the folder locally — don’t delete it.