From e75a9e031bde60fae2c1972b5f6b18571acd4d99 Mon Sep 17 00:00:00 2001 From: Ayush Date: Tue, 6 Oct 2015 00:56:08 +0530 Subject: Git: added few random things --- git.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'git.html.markdown') diff --git a/git.html.markdown b/git.html.markdown index 66b890c1..e20a4b88 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -106,15 +106,12 @@ $ git init ### config -To configure settings. Whether it be for the repository, the system itself, or global -configurations. +To configure settings. Whether it be for the repository, the system itself, +or global configurations ( global config file is `~/.gitconfig` ). ```bash # Print & Set Some Basic Config Variables (Global) -$ git config --global user.email -$ git config --global user.name - $ git config --global user.email "MyEmail@Zoho.com" $ git config --global user.name "My Name" ``` @@ -249,6 +246,9 @@ $ git commit -m "Added multiplyNumbers() function to HelloWorld.c" # automatically stage modified or deleted files, except new files, and then commit $ git commit -a -m "Modified foo.php and removed bar.php" + +# change last commit (this deletes previous commit with a fresh commit) +$ git commit --amend -m "Correct message" ``` ### diff @@ -300,8 +300,8 @@ Display commits to the repository. # Show all commits $ git log -# Show X number of commits -$ git log -n 10 +# Show only commit message & ref +$ git log --oneline # Show merge commits only $ git log --merges -- cgit v1.2.3