Skip to content

Instantly share code, notes, and snippets.

View mikemichaelis's full-sized avatar

Mike Michaelis mikemichaelis

View GitHub Profile
git clone https://dassedev.visualstudio.com/Common/_git/x-ng2-seed <your project name>
rm -rf .git <delete .git>
git init
<create your new online project repository>
git remote add origin <url of project repository>
git add --all
git commit -m'Setup'
git remote add upstream https://dassedev.visualstudio.com/Common/_git/x-ng2-seed
git fetch upstream
git merge upstream/master --allow-unrelated-histories
git merge --squash <branch to merge into current branch>
git add --all
git commit -a -m "Merged some other branch"
git checkout <branch>
git tag -a v1.4 -m "[PLATFORM] publish vx.y.z"
@mikemichaelis
mikemichaelis / gist:6d20a5dc8a02223b991b0680504d4a9f
Last active November 16, 2016 01:14
Create a publish branch with a single commit
git pull origin master
git checkout master
git checkout --orphan publish
git commmit -a -m "Initial commit"
git push origin publish
If you have the master branch checked out locally, you can also do it in two simpler steps: First reset the branch to the parent of the current commit, then force-push it to the remote.
$ git reset HEAD^ --hard
$ git push mathnet -f
http://stackoverflow.com/questions/2763006/change-the-current-branch-to-master-in-git
The problem with the other two answers is that the new master doesn't have the old master as an ancestor, so when you push it, everyone else will get messed up. This is what you want to do:
git checkout better_branch
git merge --strategy=ours master # keep the content of this branch, but record a merge
git checkout master
git merge better_branch # fast-forward master up to the merge
If you want your history to be a little clearer, I'd recommend adding some information to the merge commit message to make it clear what you've done. Change the second line to:
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
<h1>hello, world</h1>
typings
app/**/*.js
app/**/*.map
node_modules
jspm_packages
bower_components
@mikemichaelis
mikemichaelis / gist:5265989
Created March 28, 2013 19:15
Stretch ListBox Item Content
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
</Style>
</ListBox.ItemContainerStyle>