Skip to content

Instantly share code, notes, and snippets.

@akesson
Last active March 3, 2017 11:50
Show Gist options
  • Save akesson/33cea5c08ddae2d2a82fcf9ed7d6a604 to your computer and use it in GitHub Desktop.
Save akesson/33cea5c08ddae2d2a82fcf9ed7d6a604 to your computer and use it in GitHub Desktop.
Useful git commands

Finding which the branch of a tag

Find the sha first:

git log -1 $TAG_NAME --format="%h"

Then check which branch(es) that has the commit:

git branch --contains $SHA

Resolving merge conflict by keeping the develop version

When merging on the feature-xxx branch use

git checkout --theirs VideoEditing/Components/CameraButton.swift

You can verify that there are no differences:

git diff develop --  VideoEditing/Components/CameraButton.swift

If you want to change back to feature-xxx version:

git checkout --ours VideoEditing/Components/CameraButton.swift

Updating local tags

git tag -l | xargs git tag -d
git fetch --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment