The suggested workflow is the workflow described at http://nvie.com/posts/a-successful-git-branching-model/, with the following differences:
develop branch rather than the master branch, to ensure that new features become available early on.master branch when they are not dependent on other features in the develop branch, more often tagging the master branch.git clone git@git.cryto.net projects/$username/$reponame
| Variable | Explanation |
|---|---|
| $username | Your Cryto GIT username |
| $reponame | The name of the new repository you want to create. This will be created in your working directory as a new folder, containing the actual repository contents. |
ssh git@git.cryto.net fork projects/$otheruser/$otherrepo projects/$username/$reponame
| Variable | Explanation |
|---|---|
| $otheruser | Cryto GIT username of the user whose repository you want to fork |
| $otherrepo | Name of the repository you want to fork |
| $username | Your Cryto GIT username |
| $reponame | The name of the new remote repository you want to create. |
After forking the repository remotely, you can obtain a local copy of the repository by doing
git clone git@git.cryto.net projects/$username/$reponame
Replacing the space between git.cryto.net and projects with a colon (:) fixes this.
git clone git@git.cryto.net:projects/$username/$reponame
GIT will only commit changes in files that you explicitly told it to watch. As such, you need to 'track' files before making a commit on a new file.
git add -A
git commit -a -m "Your commit message goes here"
git push origin master
git push
When your project makes use of for example a develop branch, you'll need this to work with the same branches as other developers. Run it once for each branch you wish to work with. If the branch does not exist on the remote yet, it will be created and automatically tracked.
git checkout origin/$branch -b $branch
| Variable | Explanation |
|---|---|
| $branch | The name of the branch you wish to create. |
You will usually use this feature to create a local 'feature branch' - a branch that doesn't have to be in the remote repository, in which you develop a specific feature. Make sure you are switched to the branch you wish to branch off from (this will usually be develop). The following will create a new branch and switch to it.
git branch $branch git checkout $branch
| Variable | Explanation |
|---|---|
| $branch | The name of the branch you wish to create or track. |
If you've been working on a branch locally, and you decide to push it to the remote repository (so that, for example, other devs can collaborate on it with you), make sure you're in the local branch you wish to push, and do
git push origin $branch
| Variable | Explanation |
|---|---|
| $branch | The name of the branch you wish to push. |
Don't forget to commit your changes before switching to a different branch!
git checkout $branch
| Variable | Explanation |
|---|---|
| $branch | The name of the branch you wish to switch to. |
First, switch to the branch you want to merge into. Then run
git merge --no-ff $branch
| Variable | Explanation |
|---|---|
| $branch | The branch that you wish to merge into the current branch. |
You will usually be doing this when a new release version is merged into the master branch. Ensure you are in the master branch (or another correct branch, if you have a different usecase).
git tag -a $version
| Variable | Explanation |
|---|---|
| $version | The version number you wish this release to have. |