📝 Git & GitHub

Your First Git Commit

P
Author
Pyland
📅
Published
30.06.2026
⏱️
Reading time
1 min
👁️
Views
91
🌱
Level
Beginner

Git will create a hidden .git folder — everything is stored there.

Initializing a repository

# Inside your project folder
git init

Git will create a hidden .git folder — everything is stored there.

Configuration (one time only)

git config --global user.name "Your Name"
git config --global user.email "your@email.com"

First commit

# See what has changed
git status

# Add files to the staging area
git add .               # all files
git add README.md       # a specific file
git add src/           # a folder

# Create the commit
git commit -m "feat: initial project setup"

A common mistake — forgetting .gitignore

Create a .gitignore file BEFORE your first commit:

# Python
__pycache__/
*.pyc
.env
venv/
.venv/

# Django
db.sqlite3
staticfiles/
media/

# IDE
.vscode/
.idea/
git add .gitignore
git commit -m "chore: add .gitignore"

Viewing history

git log                 # full history
git log --oneline       # compact view
git show HEAD           # last commit

Connecting to GitHub

# Create a repository on github.com, then:
git remote add origin https://github.com/username/repo.git
git branch -M main
git push -u origin main

Full workflow

# 1. Make your changes
# 2. See what changed
git status
git diff

# 3. Stage and commit
git add .
git commit -m "feat: add task creation form"

# 4. Push to GitHub
git push

Your reaction to the article

💬 Comments (0)

🔐 Sign in to leave a comment
🚪 Login
💭

No comments yet

Be the first to share your opinion about this article!

🔗 Similar

Similar articles

Continue learning with these materials

📝

Git Hosting Platforms

GitHub, GitLab, Bitbucket — key differences and recommendations.

📅 06.05.2026 👁️ 290
📝

What Is a Git Commit and Why Do You Need It? 📸

A commit is a saved snapshot of your project at a specific point in time...

📅 06.05.2026 👁️ 149
📝

Why Git won over every other version control syst…

Today Git is the de facto standard for version control in software development. But it...

📅 06.05.2026 👁️ 142

Did you like the article?

Subscribe to our updates and receive new articles first. Grow with PyLand!