Difference between revisions of "Goat"
| (One intermediate revision by the same user not shown) | |||
| Line 16: | Line 16: | ||
<code>git config --unset-all <key></code></br> | <code>git config --unset-all <key></code></br> | ||
<code>git config --remove-section <section></code></br> | <code>git config --remove-section <section></code></br> | ||
Merge on pull</br> | |||
<code>git config pull.rebase false</code></br> | |||
== git branches == | == git branches == | ||
| Line 61: | Line 64: | ||
== git reset == | == git reset == | ||
Go back to previous commit, keep changes</br> | Go back to previous commit, keep changes</br> | ||
<code>git reset --soft <commithash></code></br> | <code>git reset --soft <commithash></code></br> | ||
| Line 66: | Line 70: | ||
Go back to previous commit, discard changes (destructive/dangerous)</br> | Go back to previous commit, discard changes (destructive/dangerous)</br> | ||
<code>git reset --hard <commithash></code></br> | <code>git reset --hard <commithash></code></br> | ||
== git remote == | |||
Add remote origin</br> | |||
<code>git remote add origin <uri></code></br> | |||
Push to remote repo</br> | |||
<code>git push origin main</code></br> | |||
== git push == | |||
Push to remote repo</br> | |||
<code>git push origin main</code></br> | |||
== git pull == | |||
Pull from remote repo</br> | |||
<code>git pull origin main</code></br> | |||
Latest revision as of 20:32, 30 March 2025
git
git config
Set user name
git config --add [--global] user.name "anon"
Set user email
git config --add [--global] user.email "[email protected]"
Read
git config list [--local]
git config --get <key.value>
Remove
git config --unset <key.value>
git config --unset-all <key>
git config --remove-section <section>
Merge on pull
git config pull.rebase false
git branches
Show current branch
git branch
Rename branch
git branch -m <oldname> <newname>
Create new branch
git branch <newbranch>
Delete branch
git branch -d <branch>
Create new branch and switch
git switch -c <newbranch>
Switch branch
git switch <branch>
git checkout <branch>
git log
Show logs
git log
Show logs on one line
git log --oneline
Show logs with full decoration
git log --decoration=full
Show all branches with graph
git log --graph --all
Show all merge parents
git log --oneline --decorate --graph --parents
git merge
Merge branches
git merge <branchname>
git reset
Go back to previous commit, keep changes
git reset --soft <commithash>
Go back to previous commit, discard changes (destructive/dangerous)
git reset --hard <commithash>
git remote
Add remote origin
git remote add origin <uri>
Push to remote repo
git push origin main
git push
Push to remote repo
git push origin main
git pull
Pull from remote repo
git pull origin main