Navigation Menu

Skip to content

Commit

Permalink
Issue mozfr#466: Add upstream remote in setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalchevrel committed May 11, 2015
1 parent 207ebb8 commit 7b17676
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
18 changes: 13 additions & 5 deletions README.md
Expand Up @@ -57,14 +57,22 @@ Note that if you launch start.sh again after the installation, it will not downl

## Contribution tips

- Add Transvision parent project as remote:
"git remote add transvision git@github.com:mozfr/transvision.git"
- Add Transvision parent project as a remote repository called 'upstream':
```bash
git remote add upstream git@github.com:mozfr/transvision.git
```
- Update your branch to the last version of Transvision:
"git pull transvision master"
```bash
git pull upstream master"
```
- Launch unit tests:
"php vendor/atoum/atoum/bin/atoum -d tests/units/"
```bash
php vendor/atoum/atoum/bin/atoum -d tests/units/
```
- Update dependencies with composer:
"php composer.phar update" (or "composer update" if installed globally)
```bash
php composer.phar update (or "composer update" if installed globally)
```
- Check our [Coding Standards][] before submitting pull requests.
## Licence:
Expand Down
17 changes: 17 additions & 0 deletions app/scripts/dev-setup.sh
Expand Up @@ -127,3 +127,20 @@ then
echogreen "Add $stats_file2 file"
echo '{}' > $stats_file2
fi

# Add Reference repository as upstream remote
if ! $(git remote | grep upstream &> /dev/null)
then
origin=$(git config --get remote.origin.url)
remote_https='https://github.com/mozfr/transvision.git'
remote_git='git@github.com:mozfr/transvision.git'

if [ $origin == $remote_https ] || [ $origin == $remote_git ]
then
echored "Your local clone is from the reference repository, you should clone your own fork if you intend to contribute code."
else
echogreen "${remote_git} added as upstream remote"
git remote add upstream ${remote_git}
git fetch upstream
fi
fi

0 comments on commit 7b17676

Please sign in to comment.