Committing Pushing
Committing/Pushing
Fix a commit
Reset to last git commit
Undo a commit without losing local files
Commit specific lines of code
Pick the chunks of code you do want to commit
stage this hunk means are you gonna commit this?
Options for Stage this hunk [y, n, ...]?
Stage this hunk [y, n, ...]?
Press
?
if you want more infoPress
n
to go to next change
Note: Does not work for new files (i.e. if you do a touch
, and try to do git add -p
right after)
Delete file that is already in repo
If you want to delete this file that is already in the repo, use this to not commit file-name
Show changes between commits
when you do
y
forgit add -p
,git diff
will be empty (obviously)
Do not commit specific lines of code
.gitignore
.gitignore
Checking if something's really ignored
do
git status
and check if file still appears as red
Ignoring all types of a file extension, folder, or file
*.<file-extension>
(eg. txt, swp)*<folder/file-name>
Get latest commit hash
Get commits different between two branches (parent and child)
Last updated