• This repository has been archived on 09/Nov/2017
  • Stars
    star
    431
  • Rank 100,866 (Top 2 %)
  • Language
    CoffeeScript
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Resolve git merge conflicts in Atom

Merge Conflicts

Deprecation Notice

This package is deprecated and subsumed by the Git and GitHub integration that's bundled with Atom starting with 1.18.0-beta0. I highly recommend using that instead!

Build Status

Resolve your git merge conflicts in Atom!

conflict-resolution

This package detects the conflict markers left by git merge and overlays a set of controls for resolving each and navigating among them. Additionally, it displays your progress through a merge.

Installation

apm install merge-conflicts

Features

  • Conflict resolution controls are provided for each detected conflict.
  • Choose your version, their version, combinations thereof, or arbitrary changes edited in place as a resolution.
  • Navigate to the next and previous conflicts in each file.
  • Track your progress through a merge with per-file progress bars and a file list.
  • Save and stage your resolved version of each file as it's completed.

Using

When git merge tells you that it couldn't resolve all of your conflicts automatically:

$ git merge branch
Auto-merging two
CONFLICT (content): Merge conflict in two
Auto-merging one
CONFLICT (content): Merge conflict in one
Automatic merge failed; fix conflicts and then commit the result.

Open Atom on your project and run the command Merge Conflicts: Detect (default hotkey: alt-m d). You'll see a panel at the bottom of the window describing your progress through the merge:

merge progress

Click each filename to visit it and step through the identified conflicts. For each conflict area, click "Use me" on either side of the change to accept that side as-is:

conflict area

Use the right-click menu to choose more advanced resolutions, like "ours then theirs", or edit any chunk by hand then click "use me" to accept your manual modifications. Once you've addressed all of the conflicts within a file, you'll be prompted to save and stage the changes you've made:

save and stage?

Finally, when all of the conflicts throughout the project have been dealt with, a message will appear to prompt you how to commit the resolution and continue on your way. 🎉

onward!

Key bindings

To customize your key bindings, choose "Keymap..." from your Atom menu and add CSON to bind whatever keys you wish to merge-conflicts events. To get started, you can copy and paste this snippet and change the bindings to whatever you prefer:

'atom-text-editor.conflicted':
  'alt-m down': 'merge-conflicts:next-unresolved'
  'alt-m up': 'merge-conflicts:previous-unresolved'
  'alt-m enter': 'merge-conflicts:accept-current'
  'alt-m r': 'merge-conflicts:revert-current'
  'alt-m 1': 'merge-conflicts:accept-ours'
  'alt-m 2': 'merge-conflicts:accept-theirs'

'atom-workspace':
  'alt-m d': 'merge-conflicts:detect'

For more detail, the Atom docs include both basic and advanced guidelines describing the syntax.

Events

The merge-conflicts plugin emits a number of events that other packages can subscribe to, if they wish. If you want your plugin to consume one, use code like the following:

{CompositeDisposable} = require 'atom'

pkg = atom.packages.getActivePackage('merge-conflicts')?.mainModule
subs = new CompositeDisposable

subs.add pkg.onDidResolveConflict (event) ->

# ...

subs.dispose()
  • onDidResolveConflict: broadcast whenever a conflict is resolved. event.file: the absolute path of the file in which the conflict was found; event.total: the total number of conflicts in that file; event.resolved: the number of conflicts that are resolved, including this one.
  • onDidResolveFile: broadcast whenever a file has been completed and staged for commit. event.file: the absolute path of the file that was staged.
  • onDidQuitConflictResolution: broadcast when you stop merging conflicts by clicking the quit button.
  • onDidCompleteConflictResolution: broadcast when all conflicts in all files have successfully been resolved.

Contributions

Pull requests are welcome, big and small! Check out the contributing guide for details.

More Repositories

1

slack-emojinator

Bulk upload emoji into Slack
Python
329
star
2

lets-nginx

Push button, get TLS
Shell
173
star
3

hubot-markov

Hubot watches all, and builds a markov model from everything you say.
CoffeeScript
63
star
4

stacktrace

Atom package to navigate stacktraces.
CoffeeScript
35
star
5

pushbot

A Hubot instance that's here to protect you.
JavaScript
11
star
6

cringe

Orchestrate rolling deployments of Docker containers like it's 2005
JavaScript
8
star
7

hubot-pipe

Put some Unix in your Hubot
JavaScript
7
star
8

bdtg

Roleplaying system that's just a little metal
Makefile
7
star
9

node-watchman

Docker container based on node 8's Alpine distribution
6
star
10

segment

Most programmers, at some point, daydream about writing their own programming language. This one's mine.
C
6
star
11

devstack-ansible

Ansible playbook to set up devstack from a bare server.
6
star
12

branchtree

CLI to manage chains of pull request branches
Ruby
5
star
13

dotfiles

Settings and setup.
Ruby
5
star
14

mocha-stress

Re-run flaky Mocha tests to flush out inconsistent results
JavaScript
5
star
15

kite-shell

Electron + Docker, or Kitematic - UI
JavaScript
5
star
16

websinger

Turn your backup server into a jukebox
Ruby
5
star
17

objectlite

An object database analog to SQLite.
C
4
star
18

nested-builder

Tersely construct complex test fixture objects with the builder pattern.
TypeScript
4
star
19

hubot-quotefile

Embarrass your co-workers with their own words!
CoffeeScript
4
star
20

hubot-hammersport

It's over when there's a winner.
CoffeeScript
4
star
21

hubot-plan

Event planning with robots
JavaScript
3
star
22

hubot-greetings

Customized greetings for individual people by your Hubot.
CoffeeScript
3
star
23

hubot-roller

hubot roll (1d100)d(4d17 + 5)
JavaScript
3
star
24

strac

A Trac interface to the Smalltalk STORE version control system.
Python
2
star
25

cashmonies

Console-based, simplistic financial tracking.
Ruby
2
star
26

collab.fict.io

Web UI for the collaborative fiction editor.
JavaScript
2
star
27

pr-status

Dashboard reporting build and review status of your open pull requests
TypeScript
2
star
28

typescript-module-template

Starting point for writing npm modules in TypeScript.
TypeScript
2
star
29

collaborative-fiction

Tell stories with your friends.
Rust
2
star
30

watcher-stress

Stress-test node.js filesystem watchers
JavaScript
2
star
31

flashcards

JavaScript
1
star
32

git-engineroom-tour

Presentation introducing intermediate git concepts and usage.
CSS
1
star
33

pushbot.party

Frontend for pushbot's web interface
TypeScript
1
star
34

swiftest

Pythonic client library for OpenStack Object Storage
Python
1
star
35

az-infra

System components for Azurefire infrastructure
Python
1
star
36

loghttp

HTTP transaction logger for Golang.
Go
1
star
37

az-coordinator

Container orchestration for azurefire services
Go
1
star
38

strider-dockerfile

Dockerfile for a StriderCD server to run page builds
JavaScript
1
star
39

deconst-add-content

Quick automation for content repository maintenance.
Ruby
1
star
40

pull-request

GitHub pull request magic in Atom
JavaScript
1
star
41

ascension

Nanowrimo 2010
Ruby
1
star
42

az-example

An example service used to test az-coordinator deployment.
Ruby
1
star
43

hubot-harness

Test harness for Hubot scripts and plugins
JavaScript
1
star
44

create-fixture-repository

Quickly create git repositories in known states.
TypeScript
1
star
45

gpg-matrix

Execute select atom/github tests against a matrix of gpg versions
Ruby
1
star
46

az-nginx

nginx container to front azurefire infrastructure
Shell
1
star
47

azurefire

Source code for azurefire.net
CSS
1
star
48

docker-module-test

Ansible playbook that puts the Docker module through its paces.
Shell
1
star
49

hubot-pipe-scripts

Utility scripts for use with hubot-pipe
JavaScript
1
star
50

hubot-shellish

Slightly enhanced Shell adapter for Hubot development
JavaScript
1
star
51

music-manager

Spit and duct tape solution to shuttling music around our LAN.
Ruby
1
star
52

sprint-closer

Automate the closing of Trello sprints for the DevEx team.
Go
1
star
53

az-tls

Renew TLS certifications from Let's Encrypt via DNS verification
Python
1
star
54

dev-playbook

Ansible playbook to configure machines with a reasonable set of development tools.
1
star
55

deconst-drc-blog

Jekyll content decoupled from the developer.rackspace.com repository.
HTML
1
star
56

minimal-sinatra

A minimal Sinatra app that I use to test Docker things.
Ruby
1
star
57

apm-benchmarking

Some scripts to benchmark and smoke-test apm
JavaScript
1
star
58

or-redis-cli

Shell
1
star