Skip to content

jvenezia/git-line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Line

Installation

Install Git Line scripts:

curl -s https://raw.githubusercontent.com/jvenezia/git-line/master/installer.bash | bash /dev/stdin install

By default, scripts are installed in $HOME/.local/bin. Make sure this directory is in your $PATH.

When using the commands for the first time, an interactive prompt will show to configure the current git repository.

To configure your current git repository manually:

git config git-line.development-branch 'develop'
git config git-line.protected-branches 'master develop'

git config git-line.branch-prefix-enabled 'true'
git config git-line.branch-prefix 'feature'

You can optionally add aliases in file .aliases.

To uninstall:

curl -s https://raw.githubusercontent.com/jvenezia/git-line/master/installer.bash | bash /dev/stdin uninstall

Commands

Start

usage: git line start <branch_name>

Creates a feature branch starting from DEVELOPMENT_BRANCH.

Commit

usage: git line commit

Commit all changes with a commit message.
Creates an additional empty commit if its the first commit on the branch. This is useful to force Github to use the PR title when using "Squash and merge".

Push

usage: git line push

Push the current branch and set an upstream if needed.

Switch

usage: git line switch [<partial_branch_name>]

Lists most recent branches and checkout selected one, or checkouts branch matching <partial_branch_name> if provided.

Edit

usage: git line edit 

Interactive rebase with autosquash to current branch's oldest ancestor from DEVELOPMENT_BRANCH.

Update

usage: git line update 

Updates DEVELOPMENT_BRANCH from origin, then rebase current branch onto it.

Squash

usage: git line squash [<commit_message>]

Squash all commits of current branch into one. It will not apply to branches listed in PROTECTED_BRANCHES.

Remove

usage: git line remove

Removes current branch locally and from origin. It will not apply to branches listed in PROTECTED_BRANCHES.

Nuke

usage: git line nuke

Remove all remote branches removed from origin and all local branches which remote is gone. It will not remove branches which never had remotes.

Tests

Install bats following this documentation: https://bats-core.readthedocs.io/en/stable/tutorial.html#quick-installation

Run tests:

./test/bats/bin/bats test/scripts

License

Released under the MIT License, which can be found in LICENSE.txt.

Releases

No releases published

Packages

No packages published

Languages