Create your first Git repository
Create your first Git repository
We will create a tiny notes project. The files are intentionally simple so the version-control behavior stays visible.
What you’ll learn
- Initialize a repository.
- Recognize untracked files.
- Use git status to inspect repository state.
A repository begins locally
Folder
Create ordinary project files.
README.mdgit init
Add Git repository metadata.
.gitgit status
Inspect what Git currently knows.
untracked / modified / staged
git init starts tracking capability, not automatic tracking
git init creates the repository metadata. It does not automatically create a commit and it does not mean every file is already tracked.
git status is your safest first diagnostic command. It reports the current branch, tracked changes, staged changes and untracked files.
Initialize a project and inspect its status
Run this in a disposable practice repository unless the lesson explicitly says otherwise.
mkdir notes-app
cd notes-app
git init
printf "# Notes App\n" > README.md
git statusREADME.md appears as untracked because Git sees the file but no commit currently includes it. The repository is local; no GitHub repository has been created by these commands.
Practice: Create your first repository
Your task: Add two more files, notes.txt and ideas.txt, without staging them. Run git status and predict which section they appear under.
Common pitfall to avoid
Avoid deleting or manually editing files inside .git unless you are deliberately repairing internals and know the consequences. Most everyday work should happen through Git commands.
Check your understanding
Create your first repository: what to remember
Create your first Git repository is complete when you can explain the state being changed before you run the command, not merely repeat the syntax.
Read further: official supporting documentation.
Reaching the recap and completing the quizzes are separate milestones.