Simple Python CLI Task Manager used for learning Git workflows.
python app/main.pyBefore starting, make sure GitHub authentication is set up.
➡ See GitHub Authentication Setup
Welcome! This repository is a quick introduction to Git, a version control system that helps you track changes in your code and collaborate with others.
Before using Git, configure your identity:
git config --global user.name "Your Name"
git config --global user.email "your_email@example.com"To check your configuration:
git config --global --listWhen you create a brand new project locally and want to track its changes with Git, you use git init. This sets up Git in your folder, allowing you to version control your work before pushing it to GitHub.
Use git init if:
- You are starting a project from scratch.
- You have a local folder that is not currently tracked by Git.
- You want to maintain version history locally before connecting to a remote repository.
Do not use git init if you cloned an existing repository — cloning already initializes Git for you.
-
Open or create your project folder:
mkdir my-new-project cd my-new-project -
Initialize Git in the folder:
git init
This creates a hidden
.gitfolder that Git uses to track changes. -
Stage and commit your first files:
git add . git commit -m "Initial commit"
-
(Optional) Connect your local repository to GitHub and push:
git remote add origin git@github.com:username/repo.git git push -u origin main
To copy a repository from GitHub to your computer:
git clone <repository-url>Example:
git clone git@github.com:username/project.gitCheck what has changed, what is staged, and what isn't:
git statusSee what has changed in your files:
git diffShows unstaged changes (working directory vs staging area).
git diff --stagedShows staged changes (staging area vs last commit).
Stage files so they will be included in your next commit:
git add <file-name>Add all changed files:
git add .Save your staged changes with a message:
git commit -m "Your commit message"Add co-authors to a Commit:
git commit -m "Fix login issue
Co-authored-by: Name1 <email1@example.com>
Co-authored-by: Name2 <email2@example.com>"-
There must be a blank line between the main commit message and the co-author lines.
-
Each co-author is added on a new line.
-
Email addresses should match the ones associated with their GitHub accounts.
Upload your commits to GitHub:
git pushIf the branch does not exist on the remote yet, push it with:
git push -u origin <branch-name>Retrieve the latest commits from the remote branch and automatically merges them into your current branch:
git pullIf you want to pull changes to your working branch from another (e.g. main)
git pull origin <branch-name>Download the latest commits, branches, and tags from the remote repository,
but it does not modify your current working files or merge the changes automatically:
git fetchCreate a new branch:
git branch <branch-name>List branches:
git branchSwitch to another branch:
git switch <branch-name>Create a branch and switch to it:
git switch -c <branch-name>Temporarily save changes without committing:
git stashBring the stashed changes back:
git stash applyTo see the history of commits:
git log| Purpose | Command | When to Use |
|---|---|---|
| Set username & email | git config --global user.name, git config --global user.email |
Before making commits, to identify yourself |
| Start tracking a new project | git init |
When creating a new project locally |
| Clone repository | git clone <url> |
When the repo already exists online |
| Stage files | git add |
Before committing changes |
| Commit changes | git commit -m "" |
To save a snapshot of staged changes |
| Push to remote | git push |
To upload commits to a remote repository |
| Pull from remote | git pull |
To get the latest changes from a remote repository |
| Create branch | git branch <name> |
To start working on a new branch |
| Switch branches | git switch <name> |
To move between branches |
| Create branch and switch | git switch -c <name> |
To create a new branch and switch to it |
| Check status | git status |
To see current changes, staged files, and branch info |
| Stash changes | git stash |
To temporarily save changes without committing |
| Apply stashed changes | git stash apply |
To restore previously stashed changes |
| Check logs | git log |
To see the commit history |