Git ist eine freie Software zur verteilten Versionsverwaltung von Dateien. Es wurde ursprünglich für die Quellcode-Verwaltung des Linux-Kernels entwickelt.
Die Entwicklung von Git wurde im April 2005 von Linus Torvalds begonnen, um das bis dahin verwendete Versionskontrollsystem BitKeeper zu ersetzen, welches durch eine Lizenzänderung vielen Entwicklern den Zugang verwehrte. Die erste Version erschien bereits wenige Tage nach der Ankündigung.
Quelle; damit steht dieser Absatz (wie auch andere) steht damit unter der Lizenz Creative Commons Attribution/Share Alike verfügbar.
Liste der Befehl ausgeben:
git help
usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate|--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS] The most commonly used git commands are: add Add file contents to the index bisect Find the change that introduced a bug by binary search branch List, create, or delete branches checkout Checkout a branch or paths to the working tree clone Clone a repository into a new directory commit Record changes to the repository diff Show changes between commits, commit and working tree, etc fetch Download objects and refs from another repository grep Print lines matching a pattern init Create an empty git repository or reinitialize an existing one log Show commit logs merge Join two or more development histories together mv Move or rename a file, a directory, or a symlink pull Fetch from and merge with another repository or a local branch push Update remote refs along with associated objects rebase Forward-port local commits to the updated upstream head reset Reset current HEAD to the specified state rm Remove files from the working tree and from the index show Show various types of objects status Show the working tree status tag Create, list, delete or verify a tag object signed with GPG See 'git help COMMAND' for more information on a specific command.
git init
git clone ADRESSE
als Adresse kann z. B. ein entfernter Git-Server dienen
git clone URL
git push URL localbranch master
git push URL master
git clone ssh://domain.tld/local/path/to/git/repo
git add Datei/Verzeichnis
git commit -m "Kommentar"; danach:
git add neueDatei
git commit -a -m "Kommentar"
git log
git diff
git diff HEAD
git diff TestTag HEAD
git show
git checkout PFAD_ODER_DATEI
git branch
git branch BRANCHNAME
git checkout BRANCHNAME
git checkout master
git pull . BRANCHNAME
.git/info/git format-patch original
aptitude install git-core
mkdir /srv/git/git-repos
groupadd gitusers
addgroup [USER] gitusers
cd /srv/git/git-repos/REPO1 && git --bare init
chmod 770 /srv/git/git-repos && chown -R www-data:gitusers /srv/git/git-repos/* && chmod g+wX /srv/git/git-repos/*
a2enmod dav dav_fs<Location /git-repos > DAV on AuthType Basic AuthName "Git Repository - consider using ssl to protect your credentials" #AuthBasicProvider file # (is default anyway; needs mod_authn_file which is loaded) AuthUserFile /etc/apache2/git_passwd Require valid-user #for inital tests: #Allow from all </Location>
/etc/apache2/git_passwd hinterlegen: htpasswd -c /etc/apache2/git_passwd USER
apache2 -t
apache2ctl restart
ODER
/etc/init.d/apache2 restart
mkdir REPO1
cd REPO1 && git init
git-config remote.upload.url http://<username>@<servername>/REPO1/
git push upload master
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true
Dieser Fehler tritt bei ersten push auf, wenn lokal noch gar kein master-branch existiert. Lösung: Den ersten commit machen und dann den push.
Ein push schlägt mit folgender Fehlermeldung fehl:
error: Cannot access URL https://user@host.old/repo/, return code 60 error: failed to push some refs to 'https://user@host.old/repo/'
Der Grund ist eine fehlgeschlagene Verifizierung des SSL/TLS-Zertifikats u. a. in diesen Fällen:
Temporäre Lösung (für selbst-signierte Zertifikate)
export GIT_SSL_NO_VERIFY=true
~/.gitconfig http.sslVerify=false
Permanente Lösung
News
Navigation