Netbeans and Laravel and Git, version 2

[ Spoiler: I didn’t end up going with this version either. I went with version 3.]

So I tried creating a new Laravel app by cloning the Laravel GitHub project, and that ended up giving me a Git repo that included all the branches and commits and everything from the Laravel project. Which was not what I wanted.

So I started again. I already had Composer and Git installed, so I went with the “Via Download” option on the Laravel Installation page, including php composer.phar install, and it worked fine. Then I went to my new project directory and did a git init, git add . and git commit -m "initial commit" and hey presto, I’ve got a git repo with my new Laravel project in it.

So far so hoopy. Now I want it in BitBucket, so I went to BitBucket and created a new repo and clicked “I have an existing project to push up”, and followed the instructions on how to add the new BitBucket repo as origin and push everything up. (Though I had to git push --set-upstream origin master before I could git push -u origin.) Woo hoo! Now I have my project tracked in BitBucket.

Then I went to NetBeans and did New Project -> PHP -> PHP Application with Existing Sources, selected my project folder, and hey presto, NetBeans was set up. Well, mostly. Then I went to edit the .gitignore file to add a line /nbproject/pivate/ since we don’t want that private directory to be added to the Git repo … and discovered that NetBeans had already added that line for me. Thanks, NetBeans.

Then I found this page and this page and (from Composer itself) this page, which all suggest I really should also track composer.lock, which by default is included in the .gitignore so is not tracked. So I removed the composer.lock line from .gitignore and did my next commit.

So at this point I had everything pretty much the way I wanted. Except that I then thought about vendor branches, and found this page that suggested having a branch of exactly what was downloaded from Laravel, with none of my changes in it. And of course that was ancient history for me. More than that, I didn’t have a nice clean commit point with just the Laravel stuff in it and nothing else. So I decided what the hell, I’ll delete everything and start again

Netbeans and Laravel and Git, version 2

2 thoughts on “Netbeans and Laravel and Git, version 2

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s