Quick Start with Git

  1. Initialize a repository: Run git init in your project directory to start version control.
  2. Add and commit: Use git add . to stage all changes, then git commit -m "description" to create a commit.
  3. Branch management: Use git branch to list branches, and git checkout -b new-branch to create and switch to a new branch.

Using the .gitignore Generator

Manually writing .gitignore can be error-prone. Visit HeronTool's .gitignore Generator, select your project type (e.g., Node.js, Python), and it will automatically generate rules. Place the generated file in your project root to ignore node_modules, cache files, and more.

Common Operations Tips

  • Check status: git status shows changed files.
  • Undo changes: git checkout -- file reverts unstaged changes.
  • Merge branches: Switch to the target branch and run git merge feature.

FAQ

Q: What if I accidentally commit sensitive information? Use git rm --cached file to untrack it, and update your .gitignore.
Q: How to ignore a file that is already tracked? First run git rm --cached, then add it to .gitignore.
Q: Which languages does the HeronTool generator support? It supports major languages and frameworks, with customizable rules.