Affichage des articles dont le libellé est git. Afficher tous les articles
Affichage des articles dont le libellé est git. Afficher tous les articles

mardi, juin 18, 2013

Git basic


Creer une archive zip à partir d'un tag ou d'une branche

git archive --format zip --prefix=root_folder_name/ --output /full/path/to/zipfile.zip TAG_NAME|BRANCH_NAME

Exemple avec projet hemeshgui pour creer une archive de release d'une v0.3-alpha
cd hemeshgui
git archive --format zip --prefix=hemeshgui/ --output ../hemeshgui-v0.3-alpha.zip v0.3-alpha
---------------------------------

jeudi, mai 30, 2013

Sync Github and Bitbucket


user github and bitbucket : paul
Github git repo : https://github.com/paul/app1
Bitbucket git repo : https://bitbucket.org/paul/app1

clone github repo
$git clone https://github.com/paul/app1.git
$cd app1

create new 'sync' branch and switch on it
$git checkout -b sync
$git branch

add new remote repo under name 'bitbucket'
$git remote add bitbucket https://bitbucket.org/paul/app1
$git remote -v

push the content of the sync branch on a new sync branch in 'bitbucket' repository
$git push -u bitbucket sync

Now do some change in 'sync' branch

to push changes in bitbucket just do
$git status
$git push

to update the github version
$git checkout master
$git branch
$git pull

to merge change (put sync branch content into master branch content)
$git checkout master
$git branch
$git merge sync
$git status

push any change to github
$git checkout master
$git branch
$git push
$git status


NOTE : https://gist.github.com/jcaraballo/1982605