Complete Git Zero to Hero Course with Practical Sessions. Keep Learning!
- Laptop (with admin privileges)
- Desire to Learn.
- What is Git and why use it?
- Install Git on your system.
- Set up Git:
git config(username, email).
- Creating a Repository:
git init - Cloning a Repository:
git clone <repo-url> - Staging and Committing:
git add <file>to stage.git commit -m "<message>"to commit.
- Viewing Status and Logs:
git statusto see changes.git logto view commit history.
- Create and Switch Branches:
git branch <branch-name>,git checkout <branch-name> - Merge Branches:
git merge <branch-name> - Resolve Merge Conflicts: Manual conflict resolution.
- Add Remote:
git remote add <remote-name> <url> - Push Changes:
git push <remote-name> <branch-name> - Pull Changes:
git pull <remote-name> <branch-name> - Fetching Changes:
git fetch
- View Remotes:
git remote -v - Remove or Rename Remote:
git remote remove <remote-name>,git remote rename
- View Commit History:
git log --oneline - Show Specific Commit:
git show <commit-hash> - Revert Changes:
git revert <commit-hash>
- Writing Commit Messages: Use meaningful, concise messages.
- Git Flow Models: Understand Git Flow, GitHub Flow, and Trunk-based development.
- Rebase vs Merge: Rebase for clean history, merge for preserving context.
- Git Stash: Temporarily save changes with
git stash. - Cherry-pick: Apply commits from other branches:
git cherry-pick <commit-hash> - Rebase: Use
git rebasefor cleaner commit history.
- Fork and Clone: Fork a repo and clone to local.
- Pull Requests (PR): Open, review, and merge pull requests.
- Issues & Projects: Use GitHub Issues and Project boards for collaboration.
- CI/CD with Git: Integrate Git with Jenkins, GitLab, or GitHub Actions.
- Automating Deployments: Use Git in automated build and deployment pipelines.
- Resolve Merge Conflicts: Use conflict markers to resolve issues.
- Undo Changes: Use
git reset,git checkoutto discard or undo changes. - Recover Lost Commits: Use
git reflogto recover deleted or lost commits.
- Implement a Git workflow with branching, merging, and collaboration.
- Work with remotes, push/pull, and complete a project with team collaboration.