MyThinkPond

On Java, Python, Groovy, Grails, Spring, Node.js, Linux, Arduino, ARM, Embedded Devices & Web

Posts Tagged ‘GIT’

Go lang - Revel Web Framework - .gitignore file starter sample

Posted by Venkatt Guhesan on January 25, 2016

For those of you trying to create a new Go Language - Revel Web Framework based project, here is a sample .gitignore file.

But before I provide you with the information, we need to discuss the project structure. If you visit the Revel site here, you will see their organization structure of a Revel project. In my case, their my_gocode/ folder is much deeper in what I store in my BitBucket account (or GitHub for that matter).

.
├── code
│   ├── bin
│   │   └── revel
│   ├── pkg
│   └── src
│       ├── github.com
...
│       ├── golang.org
...
│       ├── gopkg.in
...
│       └── mywebsite.com
│           └── web
│               ├── app
│               │   ├── controllers
│               │   │   └── app.go
│               │   ├── init.go
│               │   └── views
│               │       ├── App
│               │       │   └── Index.html
│               │       ├── debug.html
│               │       ├── errors
│               │       │   ├── 404.html
│               │       │   └── 500.html
│               │       ├── flash.html
│               │       ├── footer.html
│               │       └── header.html
│               ├── conf
│               │   ├── app.conf
│               │   └── routes
│               ├── messages
│               │   └── sample.en
│               ├── public
│               │   ├── css
│               │   │   └── bootstrap.css
│               │   ├── img
│               │   │   ├── favicon.png
│               │   │   ├── glyphicons-halflings.png
│               │   │   └── glyphicons-halflings-white.png
│               │   └── js
│               │       └── jquery-1.9.1.min.js
│               ├── README.md
│               └── tests
│                   └── apptest.go
├── design
│   ├── logo-design1.png
│   ├── logo-design1.psd
│   ├── logo-final.png
│   └── logo-design2.psd
├── resources
│   └── some-materialcss-templates
...

As you can see my structure also includes some PhotoShop artefacts that also needs to be stored in my BitBucket (GIT) project. In my case, I want to ignore some of the go lang artefacts and revel artefacts.

So in the project-root, I created a .gitignore with the following contents relative to my project-root:

code/bin/
code/pkg/
code/src/github.com/
code/src/golang.org/
code/src/gopkg.in/

The above tells GIT to ignore the “github.com/**”, “golang.org/**” and “gopkg.in/**” subdirectories. As you add additional dependencies, you can revise and add to the above .gitignore file as needed.

Cheers!

 

Posted in GoLang, Revel Web Framework | Tagged: , , , , | Leave a Comment »

Grails 2.X .gitignore file

Posted by Venkatt Guhesan on November 16, 2013

Grails

With a new Grails 2.X project you run into challenges on which folders to check-in into a GIT repository. You want to remove any non-essential files that Grails can rebuild at run-time. And if you are using either GITHub or BitBucket for your GIT repo’s the default .gitignore file created or provided by GITHub is setup for configured for a Grails 1.X project and not a Grails 2.X project.

 

 

 

So here are a few simple steps to help you create the correct .gitignore file for a Grails 2.X project:

Step-1: Create the following .gitignore file under the root Grails project folder:

*.iws
*Db.properties
*Db.script
.settings
.classpath
.project
.idea
eclipse
stacktrace.log
target
target-eclipse
/plugins
/web-app/plugins
/web-app/WEB-INF/classes
web-app/WEB-INF/tld/c.tld
web-app/WEB-INF/tld/fmt.tld

Step-2: Git does not allow you to check in empty (but essential folders). To avoid this you can run the following command:

find . -type d -empty -exec touch {}/.gitignore ;

The above command creates a empty “.gitignore” file below all folders. And since you now have non-empty folders, you can now check them in into Git so that if you check-out/clone the project in the future, you will have those essential but empty folders.

If you find this article useful, Tweet me on your Twitter account or +1 me on Google-Plus so that others can also benefit from this information.

Cheers

Posted in Grails, Groovy, Java, SourceControl - GIT | Tagged: , , , , | 2 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 149 other followers