Difference between revisions of "Goat"

From 6bit.ch wiki
Jump to navigation Jump to search
Line 27: Line 27:
Create new branch</br>
Create new branch</br>
<code>git branch <newbranch></code></br>
<code>git branch <newbranch></code></br>
Delete branch</br>
<code>git branch -d <branch></code></br>


Create new branch and switch</br>
Create new branch and switch</br>
Line 34: Line 37:
<code>git switch <branch></code></br>
<code>git switch <branch></code></br>
<code>git checkout <branch></code></br>
<code>git checkout <branch></code></br>


== git log ==
== git log ==
Line 48: Line 52:
Show all branches with graph</br>
Show all branches with graph</br>
<code>git log --graph --all</code></br>
<code>git log --graph --all</code></br>
Show all merge parents</br>
<code>git log --oneline --decorate --graph --parents</code></br>
== git merge ==
Merge branches</br>
<code>git merge <branchname></code></br>

Revision as of 21:02, 27 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>

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>