FASO Git Workflow
This is really mostly for internal FASO use, just as handy reference
FASO GIT WORKFLOW RULES
Generally we are going to do this (with an addition of yourname to the branch naming rules), it would be helpful for you to read it : http://scottchacon.com/2011/08/31/github-flow.html.
1. "Central" Repository will be hosted on http://github.com
2. Master is sacred, must always be deployable - never, never, never ever push to master
3. Never ever work directly on master - all work is done inside your own working branches
4. working branches are started off of master
5. working branches are named as such yourname-description-of-project. So, example, clintavo's branches might look like so clintavo-stats-improvement
6. push your working branches to origin with "git push origin feature-branch-name" - this is how we keep up with who's doing what, be sure your working branches' names are descriptive.
7. As soon as some changes have been made to a developer feature branch the developer should open a pull request. This allows us to easily keep track of progress and see diffs and discuss the feature.
8. developers should never push to master.
9. working branches are pushed to origin at least once a day - don't keep us in the dark about your branch
10. At the beginning of work each day, merge in any changes from master to keep your branch up to date with changes happening on master.
11. Optionally, we can set up an auto-deploy example, if you have a branch called "concat" we can set it up to auto deploy every time you push to something like concat.projectname.com
12. Never use dev area urls for any production use. Do not HARD CODE your URLS detect your host name and put urls in a config file.
13. When ready to go to production and/or ask questions update your pull request on github and request the FASO team leads pull your branch into master (to do this login to github, navigate to the appropriate repository, switch to the branch you have been working on, click pull requests - this should open a request to merge into master, you should also type a short message as to what things are being merged)
14. We'll review the code and pull into master and deploy
Basic Git commands used in the FASO git Workflow:
To get started with a project (after you've been added as a collaborator on it). If you're using github for windows, you can simply clone the project in the GUI interface.
git init - set up repository
git clone git@github.com:[[company]]/[[repo]].git
git pull
To work on a new project with a new branch:
git checkout master
git branch "yourname-yourbranch"
git checkout "yourname-yourbranch" //switch to branch
//edit your files, program etc
git add . // adds new files to index
git add -u // removes deleted files from index
git commit -m "your commit message"
Daily - push your changes back to github
git push origin my-feature-branch:my-feature-branch
(run this daily or more to push changes to github so we all know who's doing what)
The Normal Daily Routine
git checkout master
git pull origin master (pull changes into your local copy of master)
git checkout yourname-yourbranch (switch to your branch) (or git branch yourname-yourbranch first to create it if a new project, then switch to it)
git merge master [1]
//resolve any conflicts
[if there were conflicts be sure to run git add . & git commit again after resolving]
git push origin yourname-yourbranch (push resolved branch back to github)
// do your daily work
git add .
git add -u
git push origin yourname-yourbranch
//end of day, repeat the next day
If you have questions: login to github go to the repo/ select your branch and
issue a pull request, also you can open an issue ticket
When the feature is finished:
git checkout master
git pull origin master
git checkout yourname-yourbranch
git merge master
open (or update with a comment if pull request was already opened) a pull request from yourname-yourbranch and we will review it and pull into master.
Using Github ISSUES
Login to github, switch your context to "BoldBrush", Click "issues", Click "assigned to me" to see yours.
Creating new issues: login to github, switch context to "BoldBrush", on right of activity select the Repository this issue is about, if no repository exists for this project yet click -issues-not-assigned, add the issue and assign it to the appropriate person.
Installing Git on Windows:
Go to github and download github for windows.
If you develop on Linux, well, you probably already use git :-)
**********