Quick Start with Git
- Initialize a repository: Run
git initin your project directory to start version control. - Add and commit: Use
git add .to stage all changes, thengit commit -m "description"to create a commit. - Branch management: Use
git branchto list branches, andgit checkout -b new-branchto 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 statusshows changed files. - Undo changes:
git checkout -- filereverts 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.