๐Ÿ“ Git & GitHub

Your First Git Commit

P
Author
PyLand Team
๐Ÿ“…
Published
30.06.2026
โฑ๏ธ
Reading time
1 min
๐Ÿ‘๏ธ
Views
342
๐ŸŒฑ
Level
Beginner

Your first commit starts with initializing a repository, configuring the author identity, and selecting the files that belong in version history.

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

๐Ÿ“

Undo and Revert in GitHub Desktop: Fix Mistakes Wโ€ฆ

A commit is not a point of no return. GitHub Desktop lets you rebuild a...

๐Ÿ“… 16.07.2026 ๐Ÿ‘๏ธ 359
๐Ÿ“

History, Diffs, and Web Commits on GitHub

GitHub lets you read repository history, inspect individual commit diffs, view the history of one...

๐Ÿ“… 16.07.2026 ๐Ÿ‘๏ธ 312
๐Ÿ“

Git Hosting Platforms

GitHub, GitLab, Bitbucket โ€” key differences and recommendations.

๐Ÿ“… 06.05.2026 ๐Ÿ‘๏ธ 555
๐ŸŽ“ Continue learning

Courses that cover this material

Visit the course to apply this material in practice.

Git & GitHub Desktop: Teamwork Without the Pain Open course curriculum