Quick ways to get out of the git

Always have to search Stackoverflow for these git tips, so thought I would bang them into one place.

How to merge either all local or all remote changes

Single File
git checkout --ours filename.c
git checkout --theirs filename.c
git add filename.c
git commit -m "using theirs"

Or for all files

git checkout --ours .
git checkout --theirs .
git add .
git commit -m "using theirs"


How to delete a remote branch

git push --delete origin <branch>


How to create a branch off a branch

git checkout -b featureBranch existingBranch


Categories: git

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.