npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

git-auto-wf

v1.0.7

Published

This is an npm package to auto git workflow for your project

Downloads

5

Readme

npm i git-auto-wf

git-auto-wf is a Node.js CLI tool that automates Git workflows, making it easier to initialize repositories, commit changes, and manage remotes. It's ideal for developers who frequently start new projects or handle multiple repositories.

Get Started

Logo

Installation

Install gitwf with npm

  npm install git-auto-wf

Getting Started with git-auto-wf

Follow these simple steps to automate your Git workflow efficiently:

Step 1: Update Package.json

After installing git-auto-wf, add the following script to your package.json:

"scripts": {
  "gitwf": "gitwf"
}

Step 2: Configure Environment

Create a .env file in the root of your project and securely add your GitHub personal access token to manage GitHub operations without manual authentication each time:

SECRET_KEY="your_github_token_here"

Step 3: Run the command

Execute the tool using npm by adding it to your command line. This script lets you manage your Git workflow directly:

npm run gitwf

Step 4: Authenticate with GitHub

If not already logged in, authenticate using the GitHub CLI:

gh auth login

If you're not authenticated, the tool will prompt you to authenticate automatically.

Step 5: Repository Initialization and Management

During the initial run, if a Git repository does not already exist in your project directory, git-automate-wf will prompt you to create one.

Follow these steps to quickly set up your project with git-auto-wf:

  1. Initialize a New Git Repository

    • This tool will automatically detect if a Git repository needs to be initialized and will set it up for you.
  2. Automatically Add All Files

    • All new and untracked files will be automatically added to the staging area, ready for commit.
  3. Create an Initial Commit

    • You will be prompted to enter a commit message for the initial commit, encapsulating all changes made.
  4. Set Up a Remote Repository URL (if needed)

    • If you need to connect your local repository to a remote, git-auto-wf will prompt you to provide the remote repository URL and set it up.

If a repository is already present, the tool will skip to managing existing files and commits:

Enter commit message:

Step 6: Subsequent Usage

After completing the initial setup, using git-auto-wf becomes more streamlined. Just run:

npm run gitwf

Each subsequent execution will assess the current state of the repository and automate tasks like staging changes, committing, and managing branches or remotes as configured.

Step 6: Integrating Changes with Git Pull

git-auto-wf seamlessly handles updates from your remote repository to ensure that your local project is always up-to-date with the latest changes made by other contributors. This functionality is crucial for collaborative projects where multiple developers are making concurrent updates to the codebase.

How Git Pull Works in git-auto-wf Whenever you run the command:

npm run gitwf

The tool automatically checks for changes in the remote repository that are not present in your local branch. If changes are detected, git-auto-wf will:

  1. Pull Remote Changes and Merge Locally:

    • The tool will attempt to git pull with rebase from the current branch's upstream branch.
    • If successful, it will then try to push again.
    • If the pull operation fails (e.g., due to a merge conflict), the user is asked if they want to retry or resolve manually.
  2. Create a New Branch for Your Changes

    • If the direct merge is not desirable or feasible, the user can opt to create a new branch.
    • The user is prompted to provide a name for the new branch.
    • The changes will be committed to this new branch, which is then pushed to the remote repository.
  3. Cancel and Resolve Manually

    • This option allows the user to handle the conflict manually.
    • The operation is cancelled, and the user can manually pull changes, inspect the differences, and resolve conflicts as needed.

Note:

Remember to secure your .env file and not to expose your SECRET_KEY in any publicly accessible or shared environments. This key should be kept confidential to protect your GitHub account and repositories.

Authors