| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
#Working with source control
As a reference point, you might find it useful to check the following Git tutorial and the [Git cheatsheet] (http://www.git-tower.com/files/cheatsheet/Git_Cheat_Sheet_grey.pdf).
1.git config --global branch.autosetuprebase always will make git pull to use --rebase. (shall works with TortoiseGit as well.)
2.git config --global push.default upstream make git push --force to work with upstream of current branch only.
When working on a new feature/enhancement, or fixing a bug, every team member should use a separate feature branch. In order to make it easy to differentiate between member branches you should prefix its name with your user name - I.e. such name will look like this dvarchev/Cordova-mocks-update. In order to separate different words in branch name use dashes instead of spaces.
In order to create a new branch simply run the following git checkout -b command.
git checkout -b dvarchev/Cordova-mocks-update
If you are currently on another branch (not master) you need to append master at the end. This will create the new branch out of the master and not your current one.
git checkout -b dvarchev/Cordova-mocks-update master
When working on a separate branch you would usually push it to GitHub. You can use the git push -u origin command for that.
git push -u origin dvarchev/Cordova-mocks-update
If you want to have a shorter name for your branch locally and the verbose name only on the server branch, here is how you create and push the branch to the server (local name "mocks", server name "dvarchev/Cordova-mocks-update")
git checkout -b mocks
git push -u origin mocks:dvarchev/Cordova-mocks-updateThis way you will easily switch branches locally and on the server their name will be properly descriptive.
If you need to start working on someone else's branch, you can set it up locally as follows (the remote branch is again called "dvarchev/Cordova-mocks-update" and you will map it to a local branch called "mocks"):
git checkout -b mocks origin/dvarchev/Cordova-mocks-updateYour upstream will be set automatically and you shouldn't worry where your local branch is pointing to.
While working on a feature branch you need to regularly update with the latest changes from the master branch. You should do that using the fetch & rebase commands.
git fetch
git rebase origin/masterYou can also switch to your master, pull latest changes and rebase your feature branch. This way you'll have both your local master and local feature branch up to date.
git checkout master
git pull --rebase
git checkout dvarchev/Cordova-mocks-update
git rebase masterNote: If you use TortoiseGit to pull see tip at the bottom how to make it rebase on pull
If you have previously pushed your feature branch to the remote, push the updates as well.
git push origin dvarchev/Cordova-mocks-update --force
WARNING: This line may reset remote to you local state on ALL branches including master. See tip at the bottom on how to make it push only to upstream of current branch.
When you are finished working on your feature branch, you need to create a Pull Request from your branch to master(or release during stabilization phase). Your Pull Request must be reviewed before being merged.
On the end of every milestone a "release" branch is created in the Icenium repository to stabilize the build for the upcoming release.
After we create the release branch we keep it until we create the next one(for the next milestone release). This allows us to create hot-fixes directly on the release branch. The workflow for creating the release branch is:
Make sure a release tag has been created for the previous release.
Delete the release branch locally and remotely
git branch -D release
git push origin :releasegit checkout master
git branch releasegit push origin release###I have a change that has to be applied to the release. What should I do?
You have to commit your changes only on the release branch. The release branch will be merged into master occasionally and your changes will end up in master after all.
#Guidelines for commit messages
Summarize clearly in one line what the commit is about
Describe the problem the commit solves or the use
case for a new feature. Justify why you chose
the particular solution. Don't describe the code,
describe the intent and the approach.
See also:
| Back | FazBrowse Home | New Git URL |