Socket
Socket
Sign inDemoInstall

git-commit-file

Package Overview
Dependencies
59
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    git-commit-file

Git add and commit a single file in a single command


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
916 kB
Created
Weekly downloads
 

Readme

Source

git-commit-file (gcf)


linux windows coverage
npm dependencies downloads node

Git add and commit a single file in a single command


Introduction

git-commit-file adds and commits a single file in a single command. No other files will ever be committed.

It can be installed either globally (for CLI usage) or locally (for usage in Node code).

Where a filename is specified git-commit-file attempts to commit that file only.

Where no filename is specified git-commit-file defaults to looking for webpack.config.js or webpack.config.json

If found it attempts to commit the file referenced by output.filename in your webpack config.

You don't like the default behaviour? Fine, always specify a file and git-commit-file will never fallback to the default.


Global CLI Usage

npm install -g git-commit-file

Once installed you have access to the git-commit-file CLI command. This command has two aliases, namely gcf and gitcommitfile

gcf README.md                  # add and commit README.md
gcf -m "my message" README.md  # add and commit README.md with custom commit message
gcf ./myFile.js                # add and commit myFile.js
gcf myDir/myFile.js            # add and commit myDir/myFile.js
gcf ./myDir/myFile.js          # add and commit myDir/myFile.js
gcf                            # add and commit the file referenced by `output.filename` in your webpack config

git-commit-file exits with code 0 if the file was successfully committed else it exits with code 1

The default commit message is Updated <filename>

You can override this behaviour with the -m or --message flag.


Local usage

npm install --save git-commit-file

const gcf = require('git-commit-file')
let exitCode
exitCode = gcf('README.md')                // add and commit README.md
exitCode = gcf('README.md', 'my message')  // add and commit README.md with custom commit message
exitCode = gcf('./myFile.js')              // add and commit myFile.js
exitCode = gcf('myDir/myFile.js')          // add and commit myDir/myFile.js
exitCode = gcf('./myDir/myFile.js')        // add and commit myDir/myFile.js
exitCode = gcf()                           // add and commit the file referenced by `output.filename` in your webpack config

With a local install git-commit-file can be accessed via package.json scripts:

{
  "scripts": {
    "commit1": "git-commit-file README.md",
    "commit2": "git-commit-file -m \"my message\" README.md",
    "commit3": "git-commit-file ./myFile.js",
    "commit4": "git-commit-file myDir/myFile.js",
    "commit5": "git-commit-file ./myDir/myFile.js",
    "commit6": "gcf"
  }
}

And executed with npm run commit1 or npm run commit2 and so forth.


Author says

God made a commitment to loving you by sending his only Son Jesus to die on the cross for your sins in your place.

For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life. For God did not send his Son into the world to condemn the world, but in order that the world might be saved through him. Whoever believes in him is not condemned, but whoever does not believe is condemned already, because he has not believed in the name of the only Son of God.

John 3:16-18 ESV

Now it's your turn to make a commitment to God. Shake His hand, accept His gift (he gave his only Son) and follow Him.

Remember ... it's a gift, you can't earn it. Take it and thank Him :)




Keywords

FAQs

Last updated on 17 Mar 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc