Difference between revisions of "Goat"

From 6bit.ch wiki
Jump to navigation Jump to search
Line 3: Line 3:
== git config ==
== git config ==
Set user name</br>
Set user name</br>
<code>git config --add [--global] user.name "anon"</code>
<code>git config --add [--global] user.name "anon"</code></br>


Set user email</br>
Set user email</br>
<code>git config --add [--global] user.email "[email protected]"</code>
<code>git config --add [--global] user.email "[email protected]"</code></br>


Read</br>
Read</br>
<code>git config list [--local]</code></br>
<code>git config list [--local]</code></br>
<code>git config --get <key.value></code>
<code>git config --get <key.value></code></br>


Remove</br>
Remove</br>
<code>git config --unset <key.value></code></br>
<code>git config --unset <key.value></code></br>
<code>git config --unset-all <key></code></br>
<code>git config --unset-all <key></code></br>
<code>git config --remove-section <section></code>
<code>git config --remove-section <section></code></br>
 
== git branches ==
 
Show current branch</br>
<code>git branch</code></br>
 
Rename branch</br>
<code>git branch -m <oldname> <newname></code></br>
 
Create new branch</br>
<code>git branch <newbranch></code></br>
 
Create new branch and switch</br>
<code>git switch -c <newbranch></code></br>
 
Switch branch</br>
<code>git switch <branch></code></br>
<code>git checkout <branch></code></br>
 
== git log ==
 
Show logs</br>
<code>git log</code></br>
 
Show logs on one line</br>
<code>git log --oneline</code></br>
 
Show logs with full decoration</br>
<code>git log --decoration=full</code></br>

Revision as of 18:48, 26 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>

git branches

Show current branch
git branch

Rename branch
git branch -m <oldname> <newname>

Create new branch
git branch <newbranch>

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