Skip to content

vbeaucha/git-tuto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Git Tutorial

A comprehensive guide to mastering Git, from basic concepts to advanced techniques.

📚 Table of Contents

Getting Started

  1. Configuring Git

    • Initialize a repository
    • Set up your identity
    • Customize your environment
    • Add a Git prompt
  2. My Very First Commit

    • Create your first commit
    • Understand git status
    • Learn the basic workflow

Core Concepts

  1. Understanding Git's Tree Structure

    • The three trees: Working Directory, Index, Repository
    • Visualizing Git history
    • Using .gitignore
  2. Branches and the HEAD Position

    • Understanding HEAD
    • Creating and switching branches
    • Merging branches (with and without conflicts)
    • Resolving merge conflicts

History Management

  1. Going Back: Reset and Revert
    • Deleting commits with git reset
    • Understanding --soft, --mixed, and --hard
    • Undoing commits with git revert
    • When to use each command

Collaboration

  1. Sharing Your Repository

    • Sharing by simple copy
    • Creating bare repositories
    • Sharing via SSH
    • Working with remote repositories
    • Fetching, pulling, and pushing changes
  2. Remote Branches

    • Understanding remote branches
    • Tracking remote branches
    • Updating remote references
    • Deleting remote branches

Advanced Techniques

  1. Rebase: An Alternative to Merge

    • What is rebase?
    • Difference between merge and rebase
    • Resolving conflicts during rebase
    • Interactive rebase
    • When to use rebase vs merge
  2. Atomic Commits

    • Breaking down your commits
    • Interactive add with git add -p
    • Interactive unstaging and cancellation
  3. Stashing

    • What is stashing?
    • Basic stash usage
    • Managing stashes
    • Advanced stash options
    • Common use cases
  4. Tags

    • What are tags?
    • Creating and listing tags
    • Pushing and deleting tags
    • Checking out tags

Safety and Recovery

  1. The Reflog: Git's Safety Net
    • What is the reflog?
    • Viewing the reflog
    • Recovering lost commits
    • Reflog limitations

Workflows and Best Practices

  1. Git Workflows

    • Centralized workflow
    • Feature branch workflow
    • Gitflow workflow
    • Forking workflow
  2. Advanced Commands

    • git cherry-pick
    • git bisect
    • git blame
    • git diff
    • git clean
    • git archive
    • Useful Git aliases
  3. Best Practices

    • Writing good commit messages
    • Atomic commits
    • Commit frequency
    • Pre-push checklist
    • Never rewrite shared history
    • Using .gitignore effectively
  4. Conclusion

    • Key concepts recap
    • Useful resources

🚀 Quick Start

If you're new to Git, start with:

  1. Configuring Git
  2. My Very First Commit
  3. Understanding Git's Tree Structure

📖 How to Use This Tutorial

  • Beginners: Follow the sections in order from 1 to 16
  • Intermediate users: Jump to specific topics you want to learn
  • Reference: Use the table of contents to quickly find commands

💡 Tips

  • Practice each concept in a test repository before using it in real projects
  • Don't be afraid to experiment - the reflog can save you!
  • Commit often, push when ready
  • Read the error messages - Git usually tells you what to do

🤝 Contributing

Found an error or want to improve this tutorial? Contributions are welcome!

📝 License

This tutorial is provided as-is for educational purposes.


Happy Git-ing! 🎉

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors