Giter Club home page Giter Club logo

gitignore.io's Introduction


Create useful .gitignore files for your project

Travis Code Climate Test Coverage Code Climate Maintainability Platforms license

About

.gitignore.io is a web service designed to help you create .gitignore files for your Git repositories. The site has a graphical and command line method of creating a .gitignore for your operating system, programming language, or IDE.

.gitignore Template Source

Source templates for gitignore.io: https://github.com/toptal/gitignore

License of the generated files

All files generated by https://www.toptal.com/developers/gitignore are under CC0.

Documentation

Complete gitignore.io documentation: https://docs.gitignore.io/

Docker Container

Prerequisites

Build

Production

docker-compose up --build

Development

docker-compose -f ./docker-compose-dev.yml build
docker-compose -f ./docker-compose-dev.yml up

It will start the web server running on http://localhost:8080

Development mode mounts the following directories to docker volumes:

  • /Public
  • /Resources

LESS and CSS

The app uses LESS as its CSS preprocessor for the files in Public/css.

To process the less file you need to:

  • Install all dependencies with yarn install
  • Process the assets with yarn build

Environment Variables

Please set your environment variables to docker configurations. All are optional.

...
services:
  app:
    ...
    environment:
      HOST_ORIGIN: http://www.example.com
      BASE_PREFIX: /foo/bar
      GOOGLE_ANALYTICS_UID:
    ...
...

HOST_ORIGIN

Origin of your web server, falls back to https://www.toptal.com

HOST_ORIGIN: http://www.example.com

BASE_PREFIX

If you want to host this web server under a subdirectory (http://www.example.com/foo/bar for example), please set this variable.

BASE_PREFIX: /foo/bar

GOOGLE_ANALYTICS_UID

User ID for Google Tag Manager snippet

GOOGLE_ANALYTICS_UID: UA-XXXXXXXX-X

E2E Tests

Tests are located in e2e-tests folder with:

  • API tests in api folder - implemented using Superagent
  • E2E tests in pages folder - implemented with Puppeteer

Prerequisites:

Running:

  • Set the BASE_URL env variable (only if you have changed the default URL or port)
  • docker-compose up --build --detach
  • yarn gitupdate
  • yarn install
  • yarn build
  • yarn test
  • docker-compose stop

gitignore.io's People

Contributors

0xtim avatar berthj193 avatar christianlerke avatar dashmug avatar dependabot[bot] avatar djkeh avatar filipechagas avatar fmagrosoto avatar gisphm avatar gobr avatar joeblau avatar kaosf avatar kevinadhiguna avatar kiela avatar kjgregory avatar konstrybakov avatar koppor avatar ksatirli avatar matkoniecz avatar maxgfeller avatar mcarneiro avatar minikeb avatar mtdavidson avatar nhalink avatar rafaelplantard avatar rmunn avatar saxbophone avatar shadone avatar velo avatar wkovacs64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitignore.io's Issues

Site seems to consistently be inaccessible from Chrome on OSX

Not sure if it's being caused by a plugin or something related, but every time I access the site from my normal browser environment, the site is non-responsive and Chrome gives me "Site unreponsive, kill/wait" dialog.

Site works perfectly fine if I try to open using another browser, but not from incognito mode (which I load some plugins with still).

Add zsh to cli manual

Hi,
Here is a small snippet of zsh function for work with gitignore.io service:

echo "function gi() { curl http://gitignore.io/api/$@ ;}"  >> ~/.zshrc && . ~/.zshrc

As far as I understand, here is small difference b/w bash version - no need to escape $.
Tested with zsh 5.0.2 (x86_64-apple-darwin12.2.0)
Thanks

Site is down

Just thought you should know! Awesome work, by the way. 👍

Windows instructions not clear

  1. On docs: Script for Powershell v2, Powershell v3, alternative for msysgit (for curl.cmd) and gi.cmd are all together and looks like they are all part of the same script.
  2. Under the "Global" section, the use of "gig" is recommended for windows. gig is the function name for the Powershell v2 and v3 script, I fail to see "gig" under the msysgit alternative. Is gig meant only if you choose the Powershell scripts and not just about Windows?
  3. Following the instructions doesn't make it functional. (Upon investigation, this was a problem with curl itself).

update/improve gi command

the gi command is currently implemented as:

function gi() {
    curl http://gitignore.io/api/$@
}

which works by invoking it as gi linux,java however it could be reimplemented as:

function gi() (
    IFS=,
    curl http://gitignore.io/api/"$*"
)

that would allow calling it as gi python java which is more natural.

a second improvement would be to implement it like this:

function gi() (
    gi_args=()
    for arg; do
        if [[ $arg = -- ]]; then
            curl_args=("${gi_args[@]}")
            gi_args=()
        else
            gi_args+=("$arg")
        fi
    done
    IFS=,
    curl "${curl_args[@]}" http://gitignore.io/api/"${gi_args[*]}"
)

this allows invocations as the previous but also permits passing arguments to curl like: gi --proxy somewhere:8080 -- linux python

also notice the keyword function isn't strictly necessary if you write gi() as the definition.

Similar ignores are added up together

Thanks for awesome website!

Don't know if this is intentionally or not, but gitignore does not truncate duplicated records. For example, i'm coming from iOS development world, and i need gitignore for XCode, Objective-C and Swift. But requesting all three gives me almost identical three paragraphs of ignores.

https://www.gitignore.io/api/objective-c,swift,xcode

It would be nice, if all duplicated records would be truncated.

SSL Handshake Failure

My gi function (I'm using the git config version) hasn't been functioning lately so I investigated a bit further as to why.

Doing this curl -L https://www.gitignore.io/api ( or any argument after e.g.: curl -L https://www.gitignore.io/api/list )

Results in this error:
curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

I'm running OSX 10.8.5 and bash for my Terminal
Would anyone know how to alleviate this?

Yii2 gitignore

The existing yii 'template' can't used for the new 2.0 version of yii, for example it ignores the asset folder instead of webroot/asset.

Symfony2 .gitignore suggestion

# Assets and user uploads
/web/bundles/
/web/uploads/
/web/css/
/web/js/

I have added two last ignore directory which is generated by assetic generally and it is bundle with Symfony2 standered bundle.

gi command outputs nothing but help

It keeps outputs following:

gitignore.io help:
list - lists the operating systems, programming languages and IDE input types
:types: - creates .gitignore files for types of operating systems, programming languages or IDEs

System: OS X Mavericks
I have saved gi command in .zshrc via:
echo "function gi() { curl -s https://www.gitignore.io/api/${(j:,:)@} ;}" >> ~/.zshrc && source ~/.zshrc

Horizontal scrolling for /docs

Hej,

I just found this project and while reading the docs on my machine (MacBook Pro 13" Retina) some commands exceed the horizontal width of my screen.

Currently there is no possibility to scroll to the right to get the rest of the command.

You can highlight the beginning and alt + arrow-right to the end, but then you'll end up with breaking the whole functionality of the page as you can't "scroll back".

Couldn't this be done by an overflow in CSS?

Best,
zcei

vendor & node modules Laravel defaults

I think these two folders should be added to the Laravel default as they are populated by composer install and npm install respectively
/vendor
/node_modules

Sort output of "gi list"

At the moment, when you invoke gi list the output is not alphabetically sorted, it seems rather random. Example:

[...],webstorm,xamarinstudio,xcode,basercms,ph7cms,actionscript,[...]

Please sort the output of gi listalphabetically so it is more readable.

Support both www and non-www requests

$ curl http://gitignore.io/api
# returns nothing

$ curl http://www.gitignore.io/api
gitignore.io help:
list - lists the operating systems, programming languages and IDE input types
:types: - creates .gitignore files for types of operating systems, programming languages or IDEs

Git command line example

The current example for setting up a Git alias names the alias test, which is completely unhelpful. Essentially, running git test java ends up being the same as gi java from any of the other examples. Personally, I ended up naming mine ignore, since gi seems redundant when you're already using a git command.

$ git config --global alias.ignore '!gi() { curl -s https://www.gitignore.io/api/$@ ;}; gi'

PowerShell commands contain invalid characters

On the page http://www.gitignore.io/cli the PowerShell commands contain some invalid characters.

Specifically you can't set a variable with a \ in front of the =. ie: = will throw an error.

Both functions should be change to the following:

function gi {
  param(
    [Parameter(Mandatory=$true)]
    [string[]] $list
  )

  $params = $list -join ","
  Invoke-WebRequest -Uri "http://www.gitignore.io/api/$params" | select -ExpandProperty content | Out-File -FilePath $(Join-Path -Path $pwd -ChildPath ".gitignore") -Encoding ascii
}


function gi {
  param(
    [Parameter(Mandatory=$true)]
    [string[]]$list
  )

  $params = $list -join ","
  $wc = New-Object System.Net.WebClient
  $wc.Headers["User-Agent"] = "PowerShell/" + $PSVersionTable["PSVersion"].ToString()
  $wc.DownloadFile("http://www.gitignore.io/api/$params", "$PWD\.gitignore")
}

SSL

SSL enable gitignroe.io domain.

Create .patch data format

Create a .patch data extension to allow patching GitHubs official gitignore templates before GitHub updates them.

Eclipse.patch

.classpath
.projetc.

Windows.patch

desktop.ini 

Issues since move to cloudflare with ssl.

I can't find any other issues, and see that the documentation has changed. I just wanted to note that there were issues with this command after you updated the cloudflare to use https.

People may receive the below response resulting in an invalid .gitignore

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>

The way to fix this is to replace the command in your *rc with the correct one from the new documentation.

Migrate off of Kraken.js to Golang

This tool is good in principle, but it's plagued with bugs that don't allow the system to keep up to date with the latest dependencies.

Looking into migrating to golang.

Remove composer.lock from Composer.gitignore

An entry for composer.lock was introduced to Composer.gitignore in commit ec5d0c0. However, composer.lock should not be ignored by git!

From the Composer documentation:

Commit your application's composer.lock (along with composer.json) into version control.

This is important because the install command checks if a lock file is present, and if it is, it downloads the versions specified there (regardless of what composer.json says).

In other words, the composer.lock file is used to lock the used versions of dependencies. The file should be committed into Git in order to make sure that every developer uses the same versions of dependencies.

Also see https://stackoverflow.com/questions/12896780/composer-lock-part-of-the-repository and http://adamcod.es/2013/03/07/composer-install-vs-composer-update.html.

Please revert commit ec5d0c0.

gi is a reserved alias in PowerShell

In PowerShell gi is the alias for get-item if someone was to use your PowerShell command they would find that it would not work as expected. I would suggest changing the name to something else. Such as gitignore or giti. If PS naming standards are to be followed I'd suggest Get-GitIgnore (even though that doesn't exactly roll off the tongue).

Nested maven projects

Nested maven projects need entry:

**/target

Else sub projects targets are not ignored.

_notes and Adobe Dreaweaver trash

Hello.
gitignore.io works fine.
But I'm afraid we need a module to eliminate the _notes directories that Dreamweaver almays use.

Greetings

"ERROR: $@ is undefined." on OSX Mavericks

I'm on OSX Mavericks, and when I try to use gi from the command line as prescribed in http://www.gitignore.io/cli, this happens:

jackmaney@Jacks-Mac-mini:~$ tail -n 1 .bash_profile
function gi() { curl http://www.gitignore.io/api/\$@ ;}
jackmaney@Jacks-Mac-mini:~$ gi python
# Created by http://www.gitignore.io

#!! ERROR: $@ is undefined. Use list command to see defined gitignore types !!#

However, when I take out the backslash before $@, it seems to work:

jackmaney@Jacks-Mac-mini:~$ function foo() { curl http://www.gitignore.io/api/$@ ;}
jackmaney@Jacks-Mac-mini:~$ foo python
# Created by http://www.gitignore.io

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

(...etc)

It would seem as though the escaping of $@ is unnecessary, as further confirmed by the following:

jackmaney@Jacks-Mac-mini:~$ function blah() { echo $@ && echo $# ;}
jackmaney@Jacks-Mac-mini:~$ blah one two three
one two three
3
jackmaney@Jacks-Mac-mini:~$ function blah() { echo \$@ && echo $# ;}
jackmaney@Jacks-Mac-mini:~$ blah one two three
$@
3

Set gitignore.io as Website for GitHub Repo

Just came across this project, and noticed that there wasn't a website link above the fold, under the GitHub repo description in the header.

Otherwise, nice work! I really like your execution on this simple idea.

Query API case sensitive

When attempting to run the PowerShell function to get a gitignore file for Visual Studio I entered "VisualStudio" not thinking twice about it, and was surprised to find this in the .gitignore file

// Created by http://www.gitignore.io
// !! ERROR: VisualStudio is undefined. Use list command to see defined gitignore types !!#

I would suggest one of two fixes for this. Adjust the API to not be case sensitive or have the scripts adjust to automatically convert to lowercase. PowerShell would be this:

$params = $list.ToLower() -join ","

MODX is missing

MODX configuration is simple (by default);

/core/cache/*
!/core/cache/.gitkeep

Maybe some more @Mark-H ?

Improve the display format of `gi list`

gi() {
  local maxColumns=1
  local calculatedColumns=$(($(echo $COLUMNS | tr -d "\n") / 45))
  local columns=$(($calculatedColumns > $maxColumns ? $calculatedColumns : $maxColumns))
  local maxWidth=120
  local calculatedWidth=$(($(echo $COLUMNS | tr -d "\n") / 1.2))
  local width=$(($calculatedWidth > $maxWidth ? $calculatedWidth : $maxWidth))

  curl -s "http://www.gitignore.io/api/$@" | tr "," "\n" | pr -$columns -t -w$width
}

I know this is not a one-liner but the output is much more readable.

(Tested on ZSH only)

Missing names in eclipse gitignore file

Hello,

Thank you for the practical tool that is gitignore.io.

I just remarked that in the gitignore file generated for eclipse, these files/directory names are missing: .classpath, .settings and .projetc. These files miss intentionaly or this
is just a forgetting?

Regards,
Aboubakar

pipe output from gi function directly to .gitignore ?

@joeblau

I was wondering, instead of printing out the output from gitignore.io/api on the terminal screen, if it could be piped directly into .gitignore

Since, most of the time, .gitignore files are created, once a git repo is initialized !

So, is it fine to change,
from this

function gi() { 
    curl http://gitignore.io/api/\$@ ;
}

to this

function gi() { 
    curl http://gitignore.io/api/\$@ >> .gitingore ;
}

If you think it's fine (and won't throw up error, you can add it to the docs ! :)

Website styling broken

Currently the website can't load its stylesheet. The request for /css/app.css returns a HTTP 500 error.
Service is still usable but doesn't look nice

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.