User Tools

Site Tools


programmieren:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
programmieren:git [2020/04/08 16:18] – [nützliche Kommandos] felixprogrammieren:git [2023/09/01 16:33] (current) – [nützliche Kommandos] felix
Line 1: Line 1:
 ====== Git ====== ====== Git ======
-===== Tutorials ===== 
-  * Derek Banas' [[https://www.youtube.com/playlist?list=PLGLfVvz_LVvQHO1PfyscjIPkNJjgHsLyH|Git Video Tutorial]] 
-  * [[http://explainxkcd.com/wiki/index.php/1597:_Git|Explain xkcd: Git]] 
-  * [[https://try.github.io/|Interaktives Tutorial]] von GitHub 
-  * [[http://tutorialzine.com/2016/06/learn-git-in-30-minutes/|Learn Git in 30 Minutes]] 
-  * [[http://onlywei.github.io/explain-git-with-d3/|Visualizing Git Concepts with D3]] 
-  * [[https://github.com/Roshanjossey/first-contributions/blob/master/translations/README.de.md|First Contribution]] (deutsche Variante inkl. "eigenen Fork aktuell halten"!) 
  
-==== Branches ====+===== Branches =====
   * GitHub: [[https://guides.github.com/introduction/flow/|Understanding the GitHub Flow]]   * GitHub: [[https://guides.github.com/introduction/flow/|Understanding the GitHub Flow]]
   * Atlassian: [[https://www.atlassian.com/git/tutorials/using-branches|Using Branches]], [[https://www.atlassian.com/git/tutorials/comparing-workflows|Comparing Workflows]] (inkl. Feature Branch Workflow)   * Atlassian: [[https://www.atlassian.com/git/tutorials/using-branches|Using Branches]], [[https://www.atlassian.com/git/tutorials/comparing-workflows|Comparing Workflows]] (inkl. Feature Branch Workflow)
Line 19: Line 12:
 ===== nützliche Kommandos ===== ===== nützliche Kommandos =====
   * alle Branches auf dem Server (aka "origin") im aktuellen Repository anzeigen: <code bash>git remote show origin</code>   * alle Branches auf dem Server (aka "origin") im aktuellen Repository anzeigen: <code bash>git remote show origin</code>
 +  * Liste aller Branches (lokal + serverseitig): <code bash>git branch -vva</code>
 +  * lokale Branches löschen, die auf dem Server-Repo bereits gelöscht sind: <code bash>git branch --v | grep "\[gone\]" | awk '{print $1}' | xargs git branch -D
 +</code>
 +
 +==== Zusammenführen ====
 +  * einzelne Commits nacheinander anwenden <code bash>git cherry-pick abc321 efg654 xyz890</code>
 +  * <code bash>git pull --rebase origin master</code>
   * Branch auf Server löschen (nach dem Merge und nachdem man den Feature-Branch lokal gelöscht hat): <code bash>git push origin :branch_name</code>   * Branch auf Server löschen (nach dem Merge und nachdem man den Feature-Branch lokal gelöscht hat): <code bash>git push origin :branch_name</code>
 +
 +==== Darstellung ====
   * Ausgabe der kompletten Historie als Graph: <code bash>git log --color --graph --oneline --all --decorate</code>   * Ausgabe der kompletten Historie als Graph: <code bash>git log --color --graph --oneline --all --decorate</code>
-  * alle Branches auf dem Server (aka “origin”) im aktuellen Repository anzeigen: <code bash>git remote show origin</code>+  * kompaktere Ausgabe: <code bash>git log --oneline</code>
  
 +  * Namenskonvention für Branches: ''JIRATICKET-123_oberfunktion_meinfeature''
 +  * neuen Branch anlegen: <code bash>git checkout master
 +git pull
 +git checkout -b DEIN_BRANCH_NAME
 +git push</code>
 +  * Code zwischenlagern, z.B. beim Wechsel des Branches <code bash>git push
 +git stash
 +git pull
 +git stash pop</code>
 ====== Themes ====== ====== Themes ======
 ===== base16-monokai ===== ===== base16-monokai =====
programmieren/git.1586355522.txt.gz · Last modified: by felix

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki