Code Monkey home page Code Monkey logo

usable-git's Introduction

usable-git

A bunch of shell scripts that make using git bearable.

This is for working with branches on forks of projects, not directly commiting to a project's master. It's expected that your changes will go through the GitHub PR process to actually end up commited to the project.

Installation

Run the following commands in a terminal:

mkdir -p ~/bin
cd ~/bin
git clone [email protected]:Hixie/usable-git
echo 'export PATH=$PATH:~/bin/usable-git' >> ~/.bash_profile

Then, open a new terminal.

Usage:

clone flutter engine me

Prepares a local checkout of your fork of flutter/engine (where your fork is in me/engine).

br

List current branches.

new foo

Create a branch foo.

d

Show a diff of your changes on the current branch.

add quux.dart baz.dart

Add the local files to the repo (stage for commit).

clean

Show you what files would be deleted by running git clean, and gives you instructions for doing so.

commit

Commit the current changes using emacsclient to write the commit message.

amend

Update the current commit with new changes.

save

Commit your current changes with the message "wip" and upload it to GitHub on your fork, merging any remote changes in as well.

push

Send the current branch to GitHub.

publish

Push your current master branch to your GitHub master branch.

n bar

Rename the current branch to bar.

bb master

Switch to the master branch and pull changes.

b bar

Switch to the bar branch without pulling changes.

pull

Pull the changes from upstream.

fix quux.dart

Run emacsclient on quux.dart to fix merge conflicts.

forget

Throw away local changes since last commit/amend.

revert quux.dart baz.dart

Throw away local changes vs upstream.

nuke

Delete the current branch.

Configuration

If you're using emacs, the following is a good start for a ~/.gitconfig file:

[core]
        autocrlf = false
        filemode = false
        editor = emacsclient
[branch]
        autosetuprebase = always
[pager]
       	diff = false
        commit = false
        log = false
        cl = false
        blame = false
        merge = false
        rebase = false
        help = false
        show = false
        reflog = false
        grep = false
[push]
        default = simple
[credential]
        helper = cache --timeout=315569000

usable-git's People

Contributors

hixie avatar

Watchers

Claudio Kloss avatar

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.