Question

I have several unix commands for git to push to heroku, but I have one problem, which I'm having trouble with. I have bower components which are in my .gitignore because they shouldn't be on the repo. So in the automated steps, it makes a new branch, deletes the .gitignore and adds the bower files for the Heroku push. Unfortunately at the end of the process I am left without my bower directory. How do I keep my bower directory?

gulpfile.coffee

gulp.task 'deploy', shell.task [
  'git checkout master'
  'git branch -D dist'
  'git stash'
  'git checkout -b dist'
  'rm .gitignore'
  'git add .gitignore --all'
  'gulp build',
  'git add public'
  'git commit -m "build for release"'
  'git push heroku dist:master --force'
  'git checkout master'
  'git branch -D dist'
  'git stash pop'
  'echo "Deployed."'
  'heroku open'
], ignoreErrors: true

.gitignore

public/components/bower
Was it helpful?

Solution

After you checkout master, you can do the following before deleting the dist branch:

git checkout dist -- public/components/bower
git reset
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top