git_gitea

Dies ist eine alte Version des Dokuments!


GIT und GITHUB Basisdoku

  1. Arbeitskopie = die echten Dateien, dynamisch
  2. git add addiert den aktuellen Datenstand in den Index ("Stage")
  3. HEAD zeigt immer auf letzten Commit. Ein git commit -m "Commit-Nachricht" übernimmt den Status nach HEAD.

Initialisierung: leeres Repository erzeugen und die darin vorhandenen Dateien in den lokalen git Index aufnehmen

git init
git add .

Danach initialer Commit, um den aktuellen Stand im HEAD aufzunehmen

git commit -m "Commit-Nachricht"

Kontrolle der Remote Ziele "origin" und "upstream"

git remote -v

origin  git@github.com:thommierother/docs.git (fetch)
origin  git@github.com:thommierother/docs.git (push)
upstream        git@github.com:owncloud/docs.git (fetch)
upstream        git@github.com:owncloud/docs.git (push)

Nach dem Anlegen eines eigenen Repos auf github kann man das lokale Repo mit einem Repo auf github verknüpfen.

  • origin = persönliches git Repo auf Github. Die kann ein privater Fork eines öffentlichen Repos auf github sein.

Anders bei öffentlichen Repos: Öffentliche Repos werden zunächst geforkt, also eine Kopie im eigenen Repo-Speicher als "origin" angelegt. Lokale Änderungen werden zuerst nach origin übertragen. Danach werden sie per pull request (PR) zur Übernahme nach upstream "angemeldet".

Lokale Instanz: hinzufügen des entfernten "origin"

git remote add origin git@github.com:thommierother/oc-theme-nw2.git 
git push -u origin master

Analog geht das Verbinden des öffentlichen Repos als "upstream":

git remote add upstream ''git@github.com:https://github.com/owncloud/docs.git''

pushen

git push origin Änderungen auf das eigene Repo oder auf den Fork senden

git push upstream Änderungen nach upstream senden

abholen

git fetch origin Änderungen vom eigenen Repo oder vom Fork eines öffentlichen Repos abholen

git fetch upstream Änderungen von upstream abholen

Lokale Kopie des aktuellen Arbeitsstandes auf github anlegen

git clone /pfad/zum/repository

git commit -m "Commit-Nachricht Änderungen hochladen

Update des Fork auf Github

Das geht über das lokale Repo:

Updates von Upstream holen

''$ git fetch upstream''

Zum master wechseln

''git checkout master''

Master mit upstream mergen

''git merge upstream/master''

Danach push auf den fork setzen.

Wo bin ich (aktueller Branch)

git show branch

Alle Branches im Repo zeigen

git branch -a

  main
* master
  remotes/origin/HEAD -> origin/main
  remotes/origin/main
  remotes/origin/master

Zum anderen Branch wechseln

git checkout master

Freier Wechsel zu Branch

git checkout [branchname]

Lokal erzeugten Branch im remote Repo verfügbar machen

git push origin master

synchronisiert in den Master Branch vom Remote Repo (origin)."origin" weist auf den (privaten) Fork eines Github-zentralen Repos.

Neuen Branch erstellen und zu diesem wechseln

git checkout -b feature_x

Branch löschen

git branch -d feature_x

Download eines Branch (vmware-host-modules)

git checkout -b workstation-16.2.1 origin/workstation-16.2.1

danach

git pull

update & merge

git pull

Holt Änderungen von Remote (fetch) und führt sie mit dem lokalen Stand zusammen (merge). Bei Konflikten: Dateien manuell korrigieren und danach die geänderte Datei mit git add [dateiname] einbauen. Die Unterschiede sieht man mit

git diff <quell_branch> <ziel_branch>

Lokales Ziel

git checkout //master//

Welche branch von Upstream soll wohin geholt werden?

git pull git@github.com:owncloud/docs.git BRANCH_NAME

Danach commit, review und push auf den fork bei Github

git checkout –

setzt die lokalen Änderungen auf den letzten HEAD Stand. Änderungen, die du bereits zum Index hinzugefügt hast, bleiben bestehen.

Hard Reset = Zurück auf den letzten Stand vom entfernten Repository:

git fetch origin git reset –hard origin/master

Pull requests

Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github

Basis Konfiguration eines Repos

git config -global user.name [name]

git config -global user.email [email]

git config -global core.editor [editor]
GIT User Konfiguration setzen
git config -l Konfiguration zeigen
git status zeigt,ob eine Datei editiert wurde
git-diff and git-status Show the working tree status
git commit Änderungen einspielen
git checkout -b branch2 Wechsel zwischen Branches: Neuen Branch erstellen und dort hin wechseln
git-reset[1] Reset current HEAD to the specified state
git-merge Join two or more development histories together
git-rebase Reapply commits on top of another base tip
git tag Tags zeigen (z.B. einzelne Releases)
git log Letzte Commits zeigen
git fetch <remote> Objektstruktur runterladen

Atom

https://flight-manual.atom.io/

Globale Tastenkürzel

Kürzel was machts Anmerkung
Ctrl-Shift-P Kommando-Palette
Ctrl-T oder Ctrl-P Suche nach Dateiname im Projekt
Ctrl-B Suche nach Text in offenen Dateien im Projekt
Ctrl-F Suche nach Text in allen offenen Dateien
Ctrl-Shift-F Suche nach Text in alle Dateien im Projekt

https://github.com/atom/atom/issues/6939

Workaround:

atom –clear-window-state

oder

ALT+TAB–>select atom ALT+space–> select maximize.

oder für Windows

  • Select the Atom window (using Alt-Tab or mouse)
  • Open the context menu with Alt-Space.
  • Select move using “m”
  • Press any of the arrow keys.
  • The Atom window will now be possible to drag back to the main monitor using the mouse.

Markdown

<nowrap> NOTE: An admonition paragraph draws the reader's attention to auxiliary information. Its purpose is determined by the label at the beginning of the paragraph.

Here are the other built-in admonition types:

TIP: Pro tip…

IMPORTANT: Don't forget…

WARNING: Watch out for…

CAUTION: Ensure that… </nowrap>

<nowrap> old *constrained* & unconstrained

italic _constrained_ & unconstrained

bold italic *_constrained_* & un constrained

monospace `constrained` & ``un``constrained

monospace bold `*constrained*` & ``un``constrained

monospace italic `_constrained_` & ``un``constrained

monospace bold italic `*_constrained_*` & ``un``constrained </nowrap>

Document header

<nowrap> = My Document's Title Doc Writer doc.writer@asciidoctor.org v1.0, 2018-04-11 :toc: :imagesdir: assets/images :homepage: https://asciidoctor.org

My document provides… </nowrap>

= Document Title (Level 0) == Level 1 Section Title === Level 2 Section Title ==== Level 3 Section Title ===== Level 4 Section Title ====== Level 5 Section Title == Another Level 1 Section Title

Unordered, basicview result

* Edgar Allen Poe
* Sheri S. Tepper
* Bill Bryson

Unordered, basic (alt)view result

- Edgar Allen Poe
- Sheri S. Tepper
- Bill Bryson

Nested Lists: To nest one list within another, indent each item in the sublist by four spaces. You can also nest other elements like paragraphs, blockquotes or code blocks.

Git with a cup of tea - A painless self-hosted Git service

https://gitea.io/en-us/

https://dl.gitea.io/gitea/xxx/gitea-xxx-linux-arm64

https://docs.gitea.io/en-us/upgrade-from-gitea/

Upgrade script: /etc/scripts/gitea_upgrade.sh

  • git_gitea.1664619968.txt.gz
  • Zuletzt geändert: 05/03/2024 - 10:52
  • (Externe Bearbeitung)