You are on page 1of 2

1.git diff - helps you see, compare, and understand changes in your project.

You
can use it in many
different situations, e.g. to look at current changes in your working copy, past
changes in commits,
or even to compare branches.

2.git reset - This command reverts the staging area back to the state of the last
commit,
without altering your working directory. Your changes are still there, just no
longer staged for commit.

3.git rm filename - can be used to remove individual files or a collection of


files. The primary function
of git rm is to remove tracked files from the Git index. Additionally, git rm can
be used to remove files
from both the staging index and the working directory.

4.git mv "the file's current name" "new name" - used to move or rename files within
a Git repository.
It's a more convenient way to move or rename files compared to manually deleting
and adding files.
This command also helps in tracking the history of file movements and naming
alterations.

5.git log - this command displays all of the commits in a repository's history. By
default,
the command displays each commit's: Secure Hash Algorithm (SHA).

6.git log --oneline - The oneline is an option of the git log command. The main
purpose of this
command is to print a single commit in a single line as output when the git log
command is executed
using this option. Using this option, the commits are printed in a pattern - the
commit SHA's initial 7
characters than the commit message.

7.git commit -m "comment" --amend -

8.git log -p - show all of the changes.

9.q - quit (we can press this key after git log -p command).

10. clear - clear terminal.

11.git help log - open helping page in browser.

12.git rebase - rebasing is changing the base of your branch from one commit to
another making it appear
as if you'd created your branch from a different commit. Internally, Git
accomplishes this by creating
new commits and applying them to the specified base.

13.git rebase -i --root - (we can exit from rebase with this keys: : + x + enter)

14.git rebase --abort - You can run git rebase --abort to completely undo the
rebase. Git will return
you to your branch's state as it was before git rebase was called. You can run
git rebase --skip to completely skip the commit.
15.git rebase --continue - Continue with the changes that you made.

16.

You might also like