mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Git: added few random things
This commit is contained in:
parent
037ff22ef6
commit
e75a9e031b
@ -106,15 +106,12 @@ $ git init
|
|||||||
|
|
||||||
### config
|
### config
|
||||||
|
|
||||||
To configure settings. Whether it be for the repository, the system itself, or global
|
To configure settings. Whether it be for the repository, the system itself,
|
||||||
configurations.
|
or global configurations ( global config file is `~/.gitconfig` ).
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Print & Set Some Basic Config Variables (Global)
|
# 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.email "MyEmail@Zoho.com"
|
||||||
$ git config --global user.name "My Name"
|
$ 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
|
# automatically stage modified or deleted files, except new files, and then commit
|
||||||
$ git commit -a -m "Modified foo.php and removed bar.php"
|
$ 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
|
### diff
|
||||||
@ -300,8 +300,8 @@ Display commits to the repository.
|
|||||||
# Show all commits
|
# Show all commits
|
||||||
$ git log
|
$ git log
|
||||||
|
|
||||||
# Show X number of commits
|
# Show only commit message & ref
|
||||||
$ git log -n 10
|
$ git log --oneline
|
||||||
|
|
||||||
# Show merge commits only
|
# Show merge commits only
|
||||||
$ git log --merges
|
$ git log --merges
|
||||||
|
Loading…
Reference in New Issue
Block a user