Git: Unterschied zwischen den Versionen

Aus Vosp.info
Wechseln zu:Navigation, Suche
(repository anlegen)
Zeile 8: Zeile 8:
  
 
== repository holen ==
 
== repository holen ==
 +
<source lang="bash">
 
  git clone git+ssh://user@1.2.3.4:22/var/www/git/neurepository.git
 
  git clone git+ssh://user@1.2.3.4:22/var/www/git/neurepository.git
 
  ''Cloning into 'neurepository'...''
 
  ''Cloning into 'neurepository'...''
 
  ''warning: You appear to have cloned an empty repository.''
 
  ''warning: You appear to have cloned an empty repository.''
 
+
</source>
  
 
'''beim holen eines initialisierten bare Repository'''
 
'''beim holen eines initialisierten bare Repository'''
 +
<source lang="bash">
 
  echo README > README
 
  echo README > README
 
  git add README
 
  git add README
Zeile 26: Zeile 28:
 
  ''To git+ssh://user@1.2.3.4:22/var/www/git/neurepository.git''
 
  ''To git+ssh://user@1.2.3.4:22/var/www/git/neurepository.git''
 
  ''* [new branch]      master -> master''
 
  ''* [new branch]      master -> master''
 
+
</source>
 
== Fehlermeldungen ==
 
== Fehlermeldungen ==
  
 
=== error: insufficient permission for adding an object to repository database ./objects ===
 
=== error: insufficient permission for adding an object to repository database ./objects ===
 
'''Fehler'''
 
'''Fehler'''
 +
<source lang="bash">
 
  git push origin master  
 
  git push origin master  
 
  ''error: insufficient permission for adding an object to repository database ./objects''
 
  ''error: insufficient permission for adding an object to repository database ./objects''
 
  ''fatal: failed to write object''
 
  ''fatal: failed to write object''
 
  ''error: unpack failed: unpack-objects abnormal exit''
 
  ''error: unpack failed: unpack-objects abnormal exit''
 
+
</source>
 
'''Lösung'''
 
'''Lösung'''
  
 
auf dem Server Schreibrechte kontrollieren, darf der Benutzer überhaupt push'en!
 
auf dem Server Schreibrechte kontrollieren, darf der Benutzer überhaupt push'en!
 +
<source lang="bash">
 
  chgrp git neurepository.git/ -R
 
  chgrp git neurepository.git/ -R
 
  chmod ug+rw neurepository.git/ -R
 
  chmod ug+rw neurepository.git/ -R
 
+
</source>
 
=== error: failed to push some refs to 'git+ssh://user@1.2.3.4:22/var/www/git/neurepository.git' ===
 
=== error: failed to push some refs to 'git+ssh://user@1.2.3.4:22/var/www/git/neurepository.git' ===
 
'''Fehler'''
 
'''Fehler'''
  git push  
+
<source lang="bash">
 +
  git push
 +
</source>
 
  ''No refs in common and none specified; doing nothing.''
 
  ''No refs in common and none specified; doing nothing.''
 
  ''Perhaps you should specify a branch such as 'master'.''
 
  ''Perhaps you should specify a branch such as 'master'.''
Zeile 52: Zeile 58:
 
  git push origin master
 
  git push origin master
 
== notizen ==
 
== notizen ==
 +
<source lang="bash">
 
  echo README > README
 
  echo README > README
 
  git add README
 
  git add README
Zeile 57: Zeile 64:
 
  git log
 
  git log
 
  git branch
 
  git branch
 
+
</source>
  
  
 
== Quellen ==
 
== Quellen ==
 
* [http://wiki.weinimo.de/Git-Hilfen Git-Hilfen - deutsch]
 
* [http://wiki.weinimo.de/Git-Hilfen Git-Hilfen - deutsch]

Version vom 3. Oktober 2013, 11:44 Uhr

repository anlegen

mkdir neurepository.git
cd neurepository.git
git --bare init
# ''Initialized empty Git repository in /var/www/git/neurepository.git/''

repository holen

 git clone git+ssh://user@1.2.3.4:22/var/www/git/neurepository.git
 ''Cloning into 'neurepository'...''
 ''warning: You appear to have cloned an empty repository.''

beim holen eines initialisierten bare Repository

 echo README > README
 git add README
 git commit -a -m 'README'
 ''[master (root-commit) 7301f81] README''
 ''1 file changed, 1 insertion(+)''
 ''create mode 100644 README''
 git push origin master    # muss auf jeden Fall beim leeren bare Repository gemacht werden
 ''Counting objects: 3, done.''
 ''Writing objects: 100% (3/3), 213 bytes, done.''
 ''Total 3 (delta 0), reused 0 (delta 0)''
 ''To git+ssh://user@1.2.3.4:22/var/www/git/neurepository.git''
 ''* [new branch]      master -> master''

Fehlermeldungen

error: insufficient permission for adding an object to repository database ./objects

Fehler

 git push origin master 
 ''error: insufficient permission for adding an object to repository database ./objects''
 ''fatal: failed to write object''
 ''error: unpack failed: unpack-objects abnormal exit''

Lösung

auf dem Server Schreibrechte kontrollieren, darf der Benutzer überhaupt push'en!

 chgrp git neurepository.git/ -R
 chmod ug+rw neurepository.git/ -R

error: failed to push some refs to 'git+ssh://user@1.2.3.4:22/var/www/git/neurepository.git'

Fehler

 git push
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'git+ssh://user@1.2.3.4:22/var/www/git/neurepository.git'

Lösung

git push origin master

notizen

 echo README > README
 git add README
 git commit -a -m 'README'
 git log
 git branch


Quellen