Skip to content

Commit

Permalink
Merge pull request #200 from dejanu/main
Browse files Browse the repository at this point in the history
git
  • Loading branch information
dejanu authored Nov 20, 2024
2 parents cfacc0b + 2fffbab commit de1a274
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions git.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ SYSTEM: configurations for multiple users
GLOBAL: configurations used for one user all repo on one host
LOCAL: configuration for one repo


```bash
# list the configuration: cat ~/.gitconfig 😉
git config --list
Expand All @@ -61,7 +60,9 @@ git config --global user.email "MAIL"
# Disable SSL verification if you encounter SSL certificate problem: self signed certificate
git config --global http.sslVerify false
```
* SSH
***

## SSH stuff

```bash
# Use other ssh key
Expand All @@ -74,9 +75,7 @@ Host github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/<private_key>
```

***

## Commands

* `checkout` and `reset` are generally used for making **local or private undos**, they'll modify the history of a repo and can cause conflicts when pushing to remote
Expand Down Expand Up @@ -110,12 +109,10 @@ git reset HEAD <filename>
git restore --staged <file>

# Reset current HEAD to the specified state (MIXED the default one)
git-reset
git reset

# UNDO last commit and PRESERVE changes
git reset --soft HEAD^ == git reset --soft HEAD^1
git reset --soft HEAD~1

git reset --soft HEAD^ == git reset --soft HEAD~1
# much wow (undo 2 commits)
git reset --head X 2 == git reset HEAD^^

Expand Down

0 comments on commit de1a274

Please sign in to comment.