| Code Snippet | Description |
|---|---|
git reset <file> |
unstage one file |
git config --global [key] [value] |
đ Global Scope: Saves the configuration to the ~/.gitconfig file (in your home directory). This is the default setting for all repositories under your user account (your personal laptop). Use this for your personal data (like user.name and user.email). |
git config [key] [value] |
đ Local Scope: Saves the configuration to the .git/config file within the current repository. These settings override the global settings and only apply to this specific repository. Use this for your work data in your work repository. |
git config --list |
Display Current Repository Settings: Shows all configuration settings currently in effect for the active repository. This output combines the system, global, and local settings, reflecting the actual configuration being used, with local settings overriding global ones. |
git config --global --list |
Display Global Settings: Shows all configuration settings stored in the ~/.gitconfig file (the global scope). This lets you inspect your overall user defaults, independent of any specific repository's local overrides. |
git checkout main git branch --merged |
This lists all branches that have been merged into the current branch (main in this case). If your branch appears in the list, it has been merged. If it doesnât, it hasnât been merged. |
git branch -d [branchname] |
Delete branch locally. |
git push origin --delete [branchname] |
Removes the branch from the remote repository |
git branch -r |
List all remote branch |
git branch -a |
List all local AND remote branches. Remote branches are prefixed with "remotes/". |
git checkout main git pull origin main git merge [branchname] git push origin main |
Merge completed branch into main and push main. Merged branch can be deleted. If needed, reverting is still possible without the branch. |
git checkout -b <new-branch-name> |
create a new branch |
git push --set-upstream origin <branch-name> |
When you create a new branch locally, Git doesn't automatically know where to push it on the remote server (origin). You need to tell it to create the branch on the remote and link your local branch to it. |
| Code Snippet | Description |
|---|---|
source venv/bin/activate |
virtual environment activeren |
| Code Snippet | Description |
|---|---|
flask run --debug app.run(debug=True) |
Allows running flask dev server and instantly see changes when reloading the page. |
| Code Snippet | Description |
|---|---|
venv\Scripts\activate |
virtual environment activeren |
tree /F /A > structure.txt |
tree: displays the directory structure |