Results: 1580
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
git show
Shows changes of the commit
git show a8098222d481b2c4249e09cdf639427b237a1d8f
Shows only
index.html
changes from the commit
git show a8098222d481b2c4249e09cdf639427b237a1d8f index.html
Shows changes of the last commit (HEAD always points to the last commit if it is not detached)
git show HEAD
by Valeri Tandilashvili
4 years ago
0
Git
1
Lists all commits of the local repository
git log
Lists all commits each on one line (only commit identifier and commit message)
git log --pretty=oneline
Almost the same as the above command. But the commit identifier is shortened (only the first several symbols)
git log --oneline
If we are on
master
and we want to see other branch's commits
git log another_branch
After fetching new commits from remote, we can see the new commits (even if we are on
master
)
git log origin/master --oneline
Shows some abbreviated stats for each commit
git log --stat
It shows all commits in the history of branches, tags and other refs, but it does not show commits that are not reachable from any ref
git log --all
We can even specify a format of the commits history
git log --pretty=format:"%h - %an, %ar : %s"
Where:
%h
is the commit identifier
%an
- author of the commit
%ar
- how much time ego was created
%s
- message of the commit The format result:
a11bef0 - Scott Chacon, 6 years ago : Initial commit
... Funny format which will result in:
54d459d by VLR, which created the commit 28 hours ago with comment: some messagee
git log --pretty=format:"%h by %an, which created the commit %ar with comment: %s"
by Valeri Tandilashvili
4 years ago
0
Git
1
shows the difference between the working directory and index
git difftool HEAD
Shows the difference between the commits in some of the difftool apps (that is previously configured)
git difftool a8098222d481b2c4249e09cdf639427b237a1d8f 17d3352bd6486e4c34bbfc51053c7b86911458da
Shows the difference between
login.frm
files from different commits in default diff.tool
git difftool a8098222d481b2c4249e09cdf639427b237a1d8f 17d3352bd6486e4c34bbfc51053c7b86911458da login.frm
If the diff.tool is not configured, the default console diff tool
vimdiff
will be used instead. ... Shows what default diff.tool is
git config --global merge.tool
Shows what meld.path is
git config --global mergetool.meld.path
Configure merge tool and set
meld
as default
git config --global merge.tool "meld"
git config --global mergetool.meld.path "C:\Program Files (x86)\Meld\Meld.exe"
Configure difftool prompt to false
git config --global difftool.prompt false
by Valeri Tandilashvili
4 years ago
0
Git
Git/Github Tutorial
1
Deletes the
login
branch
git branch -d login
Deletes the
login
branch (with force mode, which means - the branch will be deleted, even if it's not fully merged
git branch -D login
by Valeri Tandilashvili
4 years ago
0
Git
Git/Github Tutorial
1
Pushes commits to the remote branch
git push origin new_branch
If the branch does not exist on remote repository, first should be run this command:
git push --set-upstream origin new_branch
Alternative of the above command is this command:
git push -u origin new_branch
To delete branch
new_branch
on remote repository
git push origin new_branch --delete
by Valeri Tandilashvili
4 years ago
0
Git
Git/Github Tutorial
1
git push origin --delete new_branch
To delete branch
new_branch
on remote repository
git push origin --delete new_branch
by Valeri Tandilashvili
4 years ago
0
Git
1
Shows unstaged changes
git diff
Shows staged changes
git diff --staged
The same as the above command
git diff --cached
Shows the difference between the working directory and index (both staged and unstaged files)
git diff HEAD
Shows the difference between the commits
git diff a80982d 17d3352
Shows the difference between
login.frm
files from different commits
git diff a809822 17d3352 login.frm
by Valeri Tandilashvili
4 years ago
0
Git
1
HEAD reference location:
.git / HEAD
If the current branch is master and
HEAD
is not detached, then the content of the file will be
ref: refs/heads/master
by Valeri Tandilashvili
4 years ago
0
Git
Git/Github Tutorial
1
We are in
detached HEAD
state if the HEAD does not point to the most recent commit. We can go into
detached HEAD
if we run the command below (if the commit is not the last one)
git checkout ba48ldo
by Valeri Tandilashvili
4 years ago
0
Git
Git/Github Tutorial
1
by Valeri Tandilashvili
4 years ago
0
Git
Git/Github Tutorial
1
Results: 1580