Friday, February 13, 2015

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

No comments: