this post was submitted on 14 Oct 2023
11 points (86.7% liked)
Programming
18250 readers
70 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
When staging files to commit, you can use an interactive patch:
git add -p
Before you make your commit, you can inspect what's being committed:
git diff --cached
If there are things you want to remove, you can do so with interactive patches, too:
git reset -p
You can also pass directories or files to any of these commands to include a subset of your project in the command.
omg these are great commands, thanks for sharing :)
git is definitely a weak spot for me in general, there's a lot of commands and similar commands, so my approach until now has been to forget they exist haha
You bet! You can always check the man pages by adding a hyphen between the git commands, too, like so:
man git-diff
man git-add
It's exhaustive, but you can search the page with slash (/) ๐
honestly, i check the manpages for anything else but i never have with git ๐คฃ however I didn't know how to access the man pages for subcommands, thanks!! :)