Using query to alter sysmail servername in SQL SERVER 2012

to check db mail server configuration:

select * from
msdb.dbo.sysmail_account sa 
left join msdb.dbo.sysmail_server ss
on ss.account_id = sa.account_id;

to update the servername for an existing account:

exec msdb.dbo.sysmail_update_account_sp
@account_id = #,
@mailserver_name = 'something the resolves to an IP within your network';

GIT checkout from tag

git fetch origin
git checkout -b temp tagname

GIT diff branches, apply diff

git diff up-to-date-branch old-branch > code.diff
git apply code.diff

GIT rebase

git checkout feature-branch
git checkout -b master-rebase
git rebase -i master

(pick the first commit and squash the rest of the commits)

during merge conflicts:
git checkout --theirs .
git add .
git rebase --continue

ff merge:
git checkout master
git merge master-rebase

cleanup:
git branch -D master-rebase

----------------------------
.. to overwrite current branch1 with branch2

git checkout branch2
git merge -s ours branch1

.. this effectively makes branch1 = branch2

.. now to fast forward branch1 to sync the branches

git checkout branch1
git merge branch2

GIT force take branch changes

Situation:

[origin/branch1]  [branch1]    took only partial changes from branch2 during merge
[origin/branch2]  [branch2]    has changes 1, 2, 3


In other words, branch1 has only done a partial merge of branch2. As such branch2 has changes that are 'newer' than branch1. You can complete the merge with the following commands.

git checkout branch1
git merge branch2

But this isn't what you want. You left out those merges on purpose. In this case, you know that branch1 is up-to-date (even though it has left out some files from branch2). What you really want to do is to overwrite branch2 with branch1. You can do this with the following commands.

git checkout branch1 # branch missing files
git merge -s ours branch2 # branch with unnecessary changes


OMFG GIT REBASE

Situation:

[origin/branch1]  [branch1]  some commit message
[origin/branch2]  [branch2]  another commit message

git checkout branch1
git rebase branch2

oops...

[origin/branch1]  some commit message
[origin/branch2]  [branch2]  [branch1]   another commit message

to undo this:

git checkout branch1
git fetch origin
git reset --hard origin/branch1