Quantcast
Channel: In git, is there a simple way of introducing an unrelated branch to a repository? - Stack Overflow
Browsing all 11 articles
Browse latest View live

Answer by ShawnFeatherly for In git, is there a simple way of introducing an...

Creating a separate repository worked well for me. Didn't have to worry about a <start_point>.Create an new empty repo somewhere else.Rename the master branch to anything other than master, ie...

View Article



Answer by Daniel Reis for In git, is there a simple way of introducing an...

In recent Git versions, 2.27 at least, this can be cleanly achieved with the switchcommand:git switch --orphan <new-branch>Official documentation: https://www.git-scm.com/docs/git-switch

View Article

Answer by VonC for In git, is there a simple way of introducing an unrelated...

If your existing content was already committed, you now (Git 2.18 Q2 2018) can extract it into its own new orphan branch, since the implementation of "git rebase -i --root" has been updated to usethe...

View Article

Answer by Sing for In git, is there a simple way of introducing an unrelated...

Sometimes I just want to create empty branch in project instantly then start doing work, I will just excute following command : git checkout --orphan unrelated.branch.namegit rm --cached -r .echo "init...

View Article

Answer by unknownprotocol for In git, is there a simple way of introducing an...

The currently selected answer is correct, I would just add that coincidentally...This is actually exactly how github.com lets users create Github Pages for their repos, thru an orphaned branch called...

View Article


Answer by tcovo for In git, is there a simple way of introducing an unrelated...

There is a new feature (since V1.7.2) which makes this task a little more high-level than what's in any of the other answers.git checkout now supports the --orphan option. From the man page:git...

View Article

Answer by Benoît for In git, is there a simple way of introducing an...

Found this script at http://wingolog.org/archives/2008/10/14/merging-in-unrelated-git-branches and it works very fine !#!/bin/bashset -eif test -z "$2" -o -n "$3"; then echo "usage: $0 REPO...

View Article

Answer by Jakub Narębski for In git, is there a simple way of introducing an...

Although the solution with git symbolic-ref and removing index works, it might be conceptually cleaner to create new repository$ cd /path/to/unrelated$ git init[edit and add files]$ git add .$ git...

View Article


Answer by Greg Hewgill for In git, is there a simple way of introducing an...

Github has a feature called Project Pages where you can create a particular named branch in your project to provide files that will be served by Github. Their instructions are as follows:$ cd...

View Article


Answer by Artem Tikhomirov for In git, is there a simple way of introducing...

From Git Community Book:git symbolic-ref HEAD refs/heads/newbranch rm .git/index git clean -fdx <do work> git add your files git commit -m 'Initial commit'

View Article

In git, is there a simple way of introducing an unrelated branch to a...

While helping a friend with a git problem today, I had to introduce abranch that needed to be totally separate from the master branch.The contents of this branch really had a different origin from...

View Article
Browsing all 11 articles
Browse latest View live


Latest Images