понеділок, 12 листопада 2012 р.

work with GIT

Creating directory:


1) git init
2) git add .
3) git status
4) git commit -a -m 'comment text'
5) git remote add origin https://______WEB_URL_______.git
6) git push -u origin master

Work with git in team

git checkout -b <branch_name> //create and switch to branche
git checkout <branch_name> //switch to branche
git push origin <branch_name> //after create brnanch, when user do first push
git push //push new data to repo
git merge <branch_name> //merge with some branch


git branch -a - список бранчей
git checkout <branch_name>
git pull (if needed)
git merge master
<resolve conflicts> (if needed)
git commit -a -m 'Merged master into <branch_name>' (if needed)
git push (if needed)
git checkout master
git merge <branch_name> --no-ff --no-commit
<review code>
git commit -a -m 'Merged <branch_name> into master'
git push


For clean repo:
git clean -f -d

For back to last commit 
git stash


Information: http://habrahabr.ru/post/125999/ 

Немає коментарів:

Дописати коментар