Introduction to Git
Git is a distributed version control system that helps manage project history and collaboration. This assignment demonstrates the fundamental Git commands and workflows used in real-world projects.
Learning Objectives
- Learn Git basics and essential commands
- Use branches effectively for feature development
- Understand merging and conflict resolution
- Host code on GitHub and manage repositories
- Review commit history and track changes
Git Workflow Screenshots
1. Initialize Repository
Creating a new Git repository with git init
2. Stage and Commit Files
Using git add and git commit to save changes
3. Create and Switch Branches
Creating a new branch with git branch and git checkout
4. Merge Branches
Merging feature branch into main with git merge
5. Push to GitHub
Pushing code to remote repository with git push
6. Review Commit History
Viewing commit history with git log
Essential Git Commands
git init
Initialize a new Git repository
git add .
Stage all changes for commit
git commit -m "message"
Commit staged changes with a message
git branch <name>
Create a new branch
git checkout <branch>
Switch to a different branch
git merge <branch>
Merge branch into current branch
git push
Push commits to remote repository
git log
View commit history