rashadb
rashadb

Reputation: 2543

Deploying to Heroku and Bypassing Github

I want to deploy to Heroku through the [email protected] url instead of legacy git URLs. I've gone through every Heroku tutorial multiple times, so please don't refer me back to a Heroku site.

I've figured out that I can probably use the git URL in the settings section of the Heroku site instead of my old git URL in the settings section of the Github desktop tool to begin using git again with Heroku. Although I'm logged in to the desktop site it tells me "Authentication Failed"

"You may not have permission to access FooBar. Check Preferences to make sure you're still logged in."

I check preferences and I am still logged in. Where do I go from here?

Upvotes: 0

Views: 111

Answers (1)

rashadb
rashadb

Reputation: 2543

After much wrangling, I received a message from Heroku on how to do it in fine detail. I don't know why that can't produce as something as simple as this in their overly verbose documentation:

You don't need a github repository to push to Heroku. git is a distributed version control system, meaning that several places can have clones of a single repository. So you can just keep your git repo on your local machine and push up from there. If you have an existing node project and you would just like to push it up to a new heroku app (while blowing away any existing git history), this is the process: First, make sure that the project has a valid package.json: rm -rf node_modules npm install --quiet --production npm start If your project starts, then you're good to go. Otherwise, there's some debugging to do (you need to have all dependencies declared in package.json). Next, you create a git repository and push it to a new Heroku app: cd projectdir rm -rf .git git init echo "node_modules" > .gitignore git add . git commit -am 'initial commit' heroku create git push heroku master cd projectdir moves you into the project directory rm -rf .git deletes any existing git information git init creates a new .git directory for source control echo "node_modules" > .gitignore makes sure you don't save the code for all of your dependencies along with your project git add . adds all files in the current directory to the working tree git commit -am 'initial commit' commits the working tree heroku create creates a new heroku app git push heroku master pushes your code to the heroku app Best, Hunter

To update your code you: change and save files git commit -am 'summarize what was changed' git push heroku master

Upvotes: 1

Related Questions