Академический Документы
Профессиональный Документы
Культура Документы
Feature Development
While in the master branch (git checkout master), pull in the most recent changes: git pull [origin master] Checkout a branch, named with issue ID and a short, descriptive title: git checkout -b prj-123-hello-world (only lowercase letters, numbers, and dashes) Commit your changes at least once a day: git add README git commit -m 'Say hello.' git add README git commit -m 'Say hello to John.' Rebase against the upstream frequently to prevent your branch diverging significantly: git fetch origin master git rebase origin master or git pull --rebase origin master
Push local branch to the upstream before leaving the office: git push -u [prj-123-hello-world] Squash all the commits together via interactive rebase: git rebase -i origin/master Using the editor, squash all the commits except the oldest (first in the editor) one: pick e4c1b61 Say hello. squash c281b81 Say hello to John.
Save and close the editor. Modify the final comment to include the issue ID and all the previous comments: PRJ-123 Hello World * Say hello. * Say hello to John. Merge your changes to back into master: git checkout master git merge prj-123-hello-world Push your changes to the upstream: git push [origin master]
Release Management
While in the master branch (git checkout master), pull in the most recent changes: git pull [origin master] Create a tag the with the current date: git tag v`date "+%Y%m%d"` Push the tag to the upstream: git push --tags Copy the files to all production servers: rsync -avz --exclude=.git . prd1:/var/www/html/ rsync -avz --exclude=.git . prd2:/var/www/html/