EnglishFrenchSpanish

Ad


OnWorks favicon

git-ignore - Online in the Cloud

Run git-ignore in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command git-ignore that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


git-ignore - Add .gitignore patterns

SYNOPSIS


git-ignore [<context>] [<pattern> [<pattern>]...]

DESCRIPTION


Adds the given _pattern_s to a .gitignore file if it doesn´t already exist.

OPTIONS


<context>

-l, --local

Sets the context to the .gitignore file in the current working directory. (default)

-g, --global

Sets the context to the global gitignore file for the current user.

<pattern>

A space delimited list of patterns to append to the file in context.

PATTERN FORMAT
Pattern format as described in the git manual

· A blank line matches no files, so it can serve as a separator for readability. To
append a blank line use empty quotes "".

· A line starting with # serves as a comment. For example, "# This is a comment"

· An optional prefix ! which negates the pattern; any matching file excluded by a
previous pattern will become included again. If a negated pattern matches, this will
override lower precedence patterns sources. To use an exclamation ! as command line
argument it is best placed between single quotes ´´. For example, ´!src´

· If the pattern ends with a slash, it is removed for the purpose of the following
description, but it would only find a match with a directory. In other words, foo/
will match a directory foo and paths underneath it, but will not match a regular file
or a symbolic link foo (this is consistent with the way how pathspec works in general
in git).

· If the pattern does not contain a slash /, git treats it as a shell glob pattern and
checks for a match against the pathname relative to the location of the .gitignore
file (relative to the toplevel of the work tree if not from a .gitignore file).

· Otherwise, git treats the pattern as a shell glob suitable for consumption by
fnmatch(3) with the FNM_PATHNAME flag: wildcards in the pattern will not match a / in
the pathname. For example, "Documentation/*.html" matches "Documentation/git.html" but
not "Documentation/ppc/ppc.html" or "tools/perf/Documentation/perf.html".

· A leading slash matches the beginning of the pathname. For example, "/*.c" matches
"cat-file.c" but not "mozilla-sha1/sha1.c".

EXAMPLES


All arguments are optional so calling git-ignore alone will display first the global then
the local gitignore files:

$ git ignore
Global gitignore: /home/alice/.gitignore
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.rej
*.swo
*.swp
*.vi
*~
*.sass-cache

# OS or Editor folders
`.DS_Store`
`.Trashes`
`._*`
Thumbs.db
---------------------------------
Local gitignore: .gitignore
`.cache`
`.project`
`.settings`
`.tmproj`
nbproject

If you only want to see the global context use the --global argument (for local use
--local):

$ git ignore
Global gitignore: /home/alice/.gitignore
`.DS_Store`
`.Trashes`
`._*`
Thumbs.db

To quickly append a new pattern to the default/local context simply:

$ git ignore *.log
Adding pattern(s) to: .gitignore
`... adding ´*.log´`

You can now configure any patterns without ever using an editor, with a context and
pattern arguments: The resulting configuration is also returned for your convenience.

$ git ignore --local "" "# Temporary files" *.tmp "*.log" tmp/* "" "# Files I´d like to keep" ´!work´ ""
Adding pattern(s) to: .gitignore
`... adding ´´`
`... adding ´# Temporary files´`
`... adding ´index.tmp´`
`... adding ´*.log´`
`... adding ´tmp/*´`
`... adding ´´`
`... adding ´# Files I´d like to keep´`
`... adding ´!work´`
`... adding ´´`

Local gitignore: .gitignore

# Temporary files
index.tmp
*.log

# Files I´d like to keep
!work

Use git-ignore online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    DivFix++
    DivFix++
    DivFix++ is yours AVI video repair and
    preview software. It designed for repair
    and preview files which are on download
    from ed2k(emule), torrent, gnutella, ftp...
    Download DivFix++
  • 2
    JBoss Community
    JBoss Community
    Community driven projects featuring the
    latest innovations for cutting edge
    apps. Our flagship project JBoss AS is
    the leading Open Source,
    standards-compliant...
    Download JBoss Community
  • 3
    Django Filer
    Django Filer
    django Filer is a file management
    application for django that makes
    handling files and images a breeze.
    django-filer is a file management
    application for djang...
    Download Django Filer
  • 4
    xCAT
    xCAT
    Extreme Cluster Administration Toolkit.
    xCAT is a scalable cluster management
    and provisioning tool that provides
    hardware control, discovery, and OS
    diskful/di...
    Download xCAT
  • 5
    Psi
    Psi
    Psi is cross-platform powerful XMPP
    client designed for experienced users.
    There are builds available for MS
    Windows, GNU/Linux and macOS.. Audience:
    End Users...
    Download Psi
  • 6
    Blobby Volley 2
    Blobby Volley 2
    Official continuation of the famous
    Blobby Volley 1.x arcade game..
    Audience: End Users/Desktop. User
    interface: OpenGL, SDL. Programming
    Language: C++, Lua. C...
    Download Blobby Volley 2
  • More »

Linux commands

Ad