sudo port install git-core git-extras
git reset FILE
git checkout -b Demo
git push --all
git clone --recursive -b BRANCHNAME git@github.com:..../.....git
git diff HEAD HEAD~ git diff HEAD HEAD~~
git branch -a
git branch -r
git clone -b experimental git@github.com:companje/ofxArcText.git
cd existing_git_repo git remote add origin https://github.com/Doodle3D/Doodle3D.git git push -u origin master
git config remote.origin.url git@github.com:USER/PROJECT.git
git config -e
a git remote update followed by a git diff shows the changes you will get for a git pull
is a combination of git fetch and git merge
git push -f origin RicksVersie
git branch -av
git reflog
git branch -m master RicksVersie git branch -m PetersVersie master
git branch -D crazy-idea
git branch -M oldname newname
git config --global color.ui true
not tested yet. more info
git reset --hard HEAD
git checkout experimental git merge master
#You are in the branch you want to merge to git checkout <branch_you_want_to_merge_from> <file_paths...>
You might have cloned the project over https. Check if this is the case using
git config -l
now change the remote origin to:
git config remote.origin.url git@github.com:USER/PROJECT.git
git push origin :Leiden
(niet uit je directory structuur)
git rm -r --cached libs/
als je een nieuwe branch hebt gemaakt op een andere computer dan moet je die branch nog handmatig pushen naar remote met:
git push origin NAME
git clone url = svn checkout url git pull = svn update
git clone git://github.com/openframeworks/openFrameworks.git –depth 1
By default a couple of GUI programs are installed with git, for browsing through history and committing etc.
gitk
git gui
you might first need to run sudo apt-get install gitk
git config -e
this opens the file .git/config
if this not works because of an error in .git/config just open the file with nano:
nano .git/config
cd addons_rick/ git add ofxArcBall/ git commit -am "added ofxArcBall" git push origin master
to go back to a revision:
git checkout revisionid
to bring the repository back to it's most recent state
git checkout master
git config --global user.name "Your Name" git config --global user.email your@emailaddress.com
mkdir PROJECTNAME cd PROJECTNAME git init touch README git add README git commit -m 'first commit' git remote add origin git@github.com:YOURUSERNAME/PROJECTNAME.git git push -u origin master
git init or git --bare init
You might be cloning a non-anonymous repository from github. If you just started using github (on your machine) github first needs to trust you. You can add the contents of ~/.ssh/id_rsa.pub to the SSH public key list on github at your account settings. If you don't want that just clone the repository through https or readonly.
Some very usefull info about ssh keys etc: http://help.github.com/ssh-issues/
just run ssh-keygen
scp ~/.ssh/id_rsa.pub user@remote.example.com:/tmp/id_rsa.pub mkdir ~/.ssh chmod 700 ~/.ssh cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys
A successful Git branching model » nvie.com
http://nvie.com/posts/a-successful-git-branching-model/
hiervoor hebben we rick aan de 'git' groep toegevoegd met 'usermod -a -G git rick'. Harmen deed ook nog iets met 'chgrp'
git clone rick@git.giplt.nl:/home/giplt/git/datamining
ssh username@giplt.nl cd git mkdir newproject cd newproject/ git --bare init
if you get this message:
If you often merge with the same branch, you may want to configure the following variables in your configuration file: branch.master.remote = <nickname> branch.master.merge = <remote-ref> remote.<nickname>.url = <url> remote.<nickname>.fetch = <refspec>
open the .git/config file (ie. by git config -e) and set the branch.master.remote to origin and the branch.master.merge to refs/heads/master
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true [remote "origin"] url = rick@companje.nl:/home/rick/git/Globe4D-base #fetch = +refs/heads/*:refs/remotes/origin/* fetch = refs/heads/master
(for the record, want is nu al gedaan)
Dit zorgt er voor dat bij een commit de gepushde files als group niet de userid krijgen van degene die een bestand heeft aangemaakt, maar de gedeelde group (bij ons 'git') waarbinnen iedereen schrijfrechten heeft.
sudo chmod -R g+ws * sudo chgrp -R mygroup * git repo-config core.sharedRepository true
git remote rm origin
first do a git –bare init on the server
git remote add origin {url}
git config --global core.editor "nano"
error: src refspec master does not match any. error: failed to push some refs to ..
you're commit might went wrong or you just forgot to commit:
git commit -m 'first commit'
see this page
add submodule to a project (this means to clone another repo into a subfolder of your repo)
git submodule add git://github.com/test/test.git subfolder/test
git submodule update --init
remove a submodule
git rm --cached folder/submodule
you can also clone your repo recursively, that way also submodules are cloned.
git clone --recursive http://server/repo.git
see the git book
git submodule init git submodule update
nog niet getest:
git submodule update --init --recursive
cloning probably resulted in an empty folder. Delete the folder and try to clone again.
git ls-files
Discussion