If you're learning software development, understanding Git is one of the most useful skills you can develop.
Many beginners think Git is simply a platform for uploading code. In reality, Git is a version control system that helps developers track changes, maintain project history, and collaborate.
GitHub is a hosting platform where Git repositories can be stored and shared.
Let's understand a practical workflow.
1. Initialize a repository
Inside your project directory, run:
git init This creates a local Git repository.
Git can now track changes made to files in that project.
2. Check the current status
Run:
git status This shows which files have changed, which files are untracked, and which changes are staged.
Checking status regularly helps you understand exactly what you are preparing to commit.
3. Stage your changes
To stage a specific file:
git add app.py To stage all changes in the current directory:
git add . Staging allows you to choose which changes should be included in the next commit.
4. Create a commit
Run:
git commit -m "Add initial application functionality" A commit records a snapshot of your staged changes.
Use clear commit messages that explain what you changed.
Examples:
Fix login validationAdd settings pageImprove application startupUpdate documentation
5. Connect to GitHub
After creating a repository on GitHub, connect your local repository:
git remote add origin YOUR_REPOSITORY_URL Replace the placeholder with your actual repository URL.
6. Push your code
For a new repository, you can use:
git branch -M main git push -u origin main Your local commits are now uploaded to the remote repository.
7. Understand the everyday workflow
A simple development cycle looks like this:
git status git add . git commit -m "Describe your changes" git push Before committing, review the changes to make sure you are not accidentally including sensitive information.
Never upload passwords, API keys, private tokens, or personal credentials to a public repository.
Bonus: Useful Git commands
| Command | Purpose |
|---|---|
git log | View commit history |
git diff | Inspect unstaged changes |
git branch | List branches |
git switch -c feature-name | Create and switch to a branch |
git pull | Fetch and integrate remote changes |
git clone URL | Copy a remote repository locally |
Final thoughts
Git helps developers work with confidence because changes can be tracked and reviewed over time.
You don't need to memorize every command immediately. Start with the basic workflow and gradually learn more as your projects become larger.
Question: Which Git command do you use most often in your development workflow?

