Find code
Use grep to quickly scan your whole project for a given string.
grep -inFR "needle" /path/to/haystack
i: case insensitive searchn: output matched line numbersF: do not treat search string as regular expressionR: recursive search
Stage code for committing
- Use
git add -ito review the code you're about to stage. Chooseato add new files,uto update the tracked files in full, orpto stage code piece by piece. You will then be able to add the full chunk or entersto split it. If you need to edit a given chunk, enteringewill bring up the native OS editor (viin my case) - Use
git diff --stagedto review the staged code before committing. This helps catching unwanted edits, e.g. hardcoded passwords or unnecessary code comments