summaryrefslogtreecommitdiffhomepage
path: root/git.html.markdown
diff options
context:
space:
mode:
authorAyush <darkceil7@live.com>2015-10-06 00:56:08 +0530
committerAyush <darkceil7@live.com>2015-10-06 00:56:08 +0530
commite75a9e031bde60fae2c1972b5f6b18571acd4d99 (patch)
treef5b3050da15f380430234dba5f38bcf09594ecff /git.html.markdown
parent037ff22ef63c5f37b6657e806695bb52f46a7ec3 (diff)
Git: added few random things
Diffstat (limited to 'git.html.markdown')
-rw-r--r--git.html.markdown14
1 files changed, 7 insertions, 7 deletions
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