Hacker News new | ask | show | jobs
by dimtion 1559 days ago
The most important git feature I discovered was `git add -p`, this allows both to select which patchs to stage, but also to do a review of what you are going to stage. Combined with `git commit -v`, this allows you to have plenty of occasions to review your changes before creating your pull request.

Shameless plug, but here are other efficiency tips I wrote about, for working in a high demanding environment: https://dimtion.fr/blog/average-engineer-tips/

2 comments

For tasks that you have mentioned, there's also built-in `git gui` for those who prefer to click.
Where is that? `git: 'gui' is not a git command. See 'git --help'.`
Got it, it is not built-in on all distros. Head to https://git-scm.com/docs/git-gui/ and https://github.com/prati0100/git-gui.git/ for more.
It is part of git, some distros just split it out to a separate package ("git-gui" on Debian) to avoid pulling GUI dependencies in unnecessarily.
Sublime Merge offers a nice GUI for the workflow you're describing with `git add -p`