×
Clear all filters including search bar
Valeri Tandilashvili's Git Notes
--patch
or -p
is usedgit add --patch
Similar to the above commandgit add -p
Possible answers for the command:
y
stage this hunk for the next commit
n
do not stage this hunk for the next commit
q
quit; do not stage this hunk or any of the remaining hunks
a
stage this hunk and all later hunks in the file
d
do not stage this hunk or any of the later hunks in the file
...
The complete list of the possible answers is on the link of the notegit config --global credential.helper 'cache --timeout=3600'
git commit
-> i
- to jump into insert mode
-> esc
- takes us out of insert mode
-> :w
- to save written comment
-> :q
- to quit
------------------------
:w
and :p
can be combined into :wq
adog
globallygit config --global alias.adog "log --all --decorate --oneline --graph"
Which can lately be run using the follwing commandgit adog
After the command execution, In global config
file will be added the following[alias]
adog = log --all --decorate --oneline --graph
On which day we change which files
Git will even show us which lines of code we added and which lines of code we removed
forget
about test.php
that was tracked but is now in .gitignore
git rm --cached test.php
The command makes Git forget
about all files under docs
directory that was tracked but is now in .gitignore
git rm -r --cached docs/
file.php
to src
directory (if the directory does not exist, the file will be renamed to src
)git mv file.php src
file.php
will be moved to src/
directory (if the destination directory does not exist, git will throw the error: destination directory does not exist..
git mv file.php src/
After running the command, status of the file will be renamed
, but if we did it manually, git will identify the operation as deleted
and new file
git bisect reset
git bisect bad urhsn47f
If we don't specify the known bad commit it will assume the last commitgit bisect bad