Git Product home page Git Product logo

git-town's Introduction

Git Town logo
end-to-end test status unit test status linters and documentation test status windows tests Go report card status Netlify deploy status

Git Town provides additional Git commands that automate the creation, synchronization, shipping, and cleanup of Git branches. Compatible with all major Git workflows including Git Flow, GitHub Flow, GitLab Flow, and trunk-based development. Supports mono-repos and stacked changes. Check out this screencast for an introduction.

Typical development commands

  • git hack - create a new up-to-date feature branch off the main branch
  • git sync - update existing branches, remove shipped branches
  • git propose - create a pull or merge request for a feature branch

Stacked changes

  • git append - insert a new branch as a child of the current branch
  • git prepend - insert a new branch between the current branch and its parent
  • git set-parent - update the parent of a branch

Branch Types

  • git observe - track somebody else's feature branch without contributing to it
  • git contribute - add commits to somebody else's feature branch
  • git park - stop syncing one of your feature branches

Advanced development commands

Configuration

Installation

See the installation and configuration instructions.

Documentation

The Git Town website provides documentation for Git Town users. git town help [command] shows help on the CLI.

Contributing

Found a bug or have an idea for a new feature? Open an issue or send a pull request! Our developer documentation helps you get started.

Stargazers over time

git-town's People

Contributors

allewun avatar allonsy avatar aricahunter avatar brandonaut avatar charlierudolph avatar chrismm avatar dependabot[bot] avatar iamandrewluca avatar imgbot[bot] avatar jiexi avatar kemenaran avatar kevgo avatar koppor avatar manuelprinz avatar nezteb avatar redouglas avatar ricmatsui avatar ruudk avatar sascha-andres avatar schneems avatar shiv19 avatar siilwyn avatar sophiasaiada avatar srstevenson avatar stephenwade avatar tjni avatar tkab avatar vbekiaris avatar vinckr avatar zearin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-town's Issues

git sync-all

Syncs all local feature branches. Ends up on the same branch as started. Good for keeping the whole workspace up to date.

abort/continue scripts

Look more in depth at abort/continue scripts. If aborting is always the right option, just rollback the changes without an abort script. Otherwise be sure we have abort and continue scripts.

git kill -f

Kills a branch, even when there are uncommitted changes

Save previous branch

I frequently use git checkout - to switch to a previous branch.

Scenario:

  • Currently on feature branch A
  • Checkout another feature branch: git checkout B
  • git ship
  • After shipping, current branch will be <main_branch_name>
  • I'd expect git checkout - to take me to A at this point. In actuality, git is trying to take me to the true previous branch, which is B (which has just been shipped and deleted).

Since git ship feels like an atomic operation, I'm frequently wanting to go back to the original branch I was on before shipping. Does this issue make sense?

Git sync --abort

  • abort the rebase if it's currently ongoing
  • pop the stashed changes

git-revert

Revert to the latest Git version, i.e. throws all local changes away.

  • changed files
  • deleted files
  • new files
  • not checked in files

git ship - error when branch has no unique commits

Accidentally shipped a branch that was not any commits ahead of main. Would have likes an error.

$ git ship -m 'feature done'
git checkout dev
Switched to branch 'dev'
Your branch is up-to-date with 'origin/dev'.

git fetch --prune

git rebase origin/dev
Current branch dev is up to date.

git checkout feature
Switched to branch 'feature'
Your branch is up-to-date with 'origin/feature'.

git merge origin/feature
Already up-to-date.

git merge dev
Updating 0d375c1..d407d0f
Fast-forward
  ...

git checkout dev
Switched to branch 'dev'
Your branch is up-to-date with 'origin/dev'.

git merge --squash feature
 (nothing to squash)Already up-to-date.

git commit -a -m "feature done"
On branch dev
Your branch is up-to-date with 'origin/dev'.

nothing to commit, working directory clean

git push
Everything up-to-date

git checkout feature
Switched to branch 'feature'
Your branch is ahead of 'origin/feature' by 2 commits.
  (use "git push" to publish your local commits)

git push origin :feature
...

git checkout dev
Switched to branch 'dev'
Your branch is up-to-date with 'origin/dev'.

git branch -D feature
Deleted branch feature (was d407d0f).

$

Verbose mode

--verbose flag will show the git commands actually being run

Help page

git town or git town help to show the commands would be useful

git-ship merges master before shipping

I just shipped a slightly outdated feature branch that contained changes which conflict with master. This aborted git-ship in the middle of the squash-merge and left me with open conflicts on the master branch. I had to do a bunch of development to resolve them directly on the master branch. There should be no development on master.

Also, since the command didn't finish properly, I had to delete the feature branch manually from both the local and remote repo. This was a poor user experience.

A better way to ship seems to have git-ship merge the master branch into the shipping feature branch one more time as part of shipping. This then fails on the feature branch with the merge conflicts, gives the developer the proper space to resolve any merge conflicts on the feature branch. The following squash-merge of the up-to-date feature branch into master will then be much more straightforward and less risky.

What do you think about this change?

Local/offline mode

Was on the plane the other day and was unable to use the commands as had no network connection. (git hack and git extract can be used nicely without a network connection). Maybe add a --local flag which skips all pulls and pushes.

git kill

  • deletes the current branch from both the local and remote repository
  • asks for confirmation if the branch contains unmerged commits
  • never deletes the main branch

git sync: push tags to remote

In addition to commits, git sync should also push tags that don't exist in the remote by running git push --tags if necessary.

git ship enhancement

git ship --message "commit message"

Does the squash merge using the provided message (thus you don't need to use the editor)

How 2 install

Kevin pleasing to help for installing of git-town

git sync on non-main / non-feature branches

On some projects we have branches that are not the main nor feature branches.
I'm thinking about branches that are more stable main branches or used for deployments.
It would be nice if it would not allow me to git sync these branches or at least require that I use -f or some other option on them.

git extract

Does not work on main branch.

Did some work on master (working on a fork) and when it came time to push up wanted to move it all over to a different branch. However git extract errors if you are not on a feature branch.

I see no real problem with being able to extract from the main branch. What are your thoughts?

.main_branch_name

Shouldn't it put this into .git-town-rc instead of its own file?
Also what does rc in .git-town-rc stand for?

README Driven Development

Although I like this idea, I think the README on master should just be the features currently supported and have another branch that has the features you are thinking of supporting. (These could also just be in issues as quite a few things are currently).

git prune

Prune all local branches that have been merged into master.
Not needed if using git ship but otherwise would help.
Quick google search gives some answers, but need to have it take the main branch into account

git kill

The script is there but it is not tested nor documented in the README

Unsynced changes on main branch

Brought up by your TODO. What do we do when there are local changes on the main branch that have not been pushed to the repo?

I favor just erroring out and telling the user they have unsynced changes on the main branch they need to deal with first.

Git extract --abort

  • abort any ongoing cherry-picks
  • go back to the old feature branch
  • kill the unfinished feature branch

Make feature branches multi-user ready

In order for multiple users to use a feature branch
we must merge updates from main into it instead of rebasing it
so that we don't rewrite shared history

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.