##// END OF EJS Templates
integrations: refactor/cleanup + features, fixes #4181...
integrations: refactor/cleanup + features, fixes #4181 * added scopes on integrations, scopes are: - repo only - repogroup children only - root repos only - global (any repo) * integrations schemas now have separate section for the settings (eg. slack) and options (eg. scope/enabled) * added descriptions to integration types * added icons to integration types * added 'create new' integration page * added scope of integration to integrations list * added breadcrumbs for each repo/repogroup/global integrations pages * added sorting to integrations list * added pagination to integrations list * added icons to integrations list * added type filter to integrations list * added message to integrations list if none we found * added extra permissions check on integrations views * db migration from 56 => 57 - adds child_repos_only field * added tests for integrations triggered on events * added tests for integrations schemas * added tests for integrations views for repo/repogroup/admin

File last commit:

r1:854a839a default
r731:7a6d3636 default
Show More
squash-commits-git.rst
62 lines | 2.0 KiB | text/x-rst | RstLexer
/ docs / tutorials / squash-commits-git.rst

How to Squash Commits in |git|

To squash commits in |git|, use the following steps.

  1. Use git log to view the commits messages on your branch, and decide how many you want to squash into one commit.
  2. Using the rebase command, chose the number of commits you wish to squash. This will then open the list of commits in your default editor allowing you to chose what to do with each.
# Squash the last 4 commits
$ git rebase -i HEAD~4
  1. When the editor opens, pick the main commit, and the commits you wish to squash, and then save. This will then open the editor on the next phase where you can edit the picked commit.
pick 575447a realign bike handlebars
s 583e99c Add hipster bullhorn handlebars (dont judge me)
s 8829a05 Add initial disc brakes for stopping
s 91322e6 Add BikeEvent administration

# Rebase d839c1a..583e99c onto d839c1a (2 TODO item(s))
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commits log message
# x, exec = run command (the rest of the line) using shell
  1. Edit the picked commit to explain the squash in more detail, and then save.
# This is a combination of 4 commits.
# The first commit's message is:

The full bike setup, with brakes, handlebars, and alignment fixed.
  1. Using git log, you should now see your squashed commit message
$ git log
commit c5424b2619b1a7c01f817279df787660c76081ea
Author: user <user@ubuntu>
Date:   Wed Nov 4 19:45:37 2015 +0100

    The full bike setup, including handlebars, brakes, and alignment.
  1. If you have already push to the remote |repo|, you will need to push your changes using force, git push --force