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"

http://stackoverflow.com/questions/161813/fix-merge-conflicts-in-git

How to delete a remote branch

git push --delete origin <branch>

http://stackoverflow.com/questions/2003505/delete-a-git-branch-both-locally-and-remotely 

How to create a branch off a branch

git checkout -b featureBranch existingBranch

http://stackoverflow.com/questions/4470523/git-create-a-branch-from-another-branch

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 )

Google+ photo

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

Connecting to %s