We are using a git repository to store our project. We have our branches departing from the original branch. But now we want to create a small new project to track some docu
If your git version does not have the --orphan option, this method should be used:
git symbolic-ref HEAD refs/heads/<newbranch>
rm .git/index
git clean -fdx
After doing some work:
git add -A
git commit -m <message>
git push origin <newbranch>
You can create a branch as an orphan:
git checkout --orphan <branchname>
This will create a new branch with no parents. Then, you can clear the working directory with:
git rm --cached -r .
and add the documentation files, commit them and push them up to github.
A pull or fetch will always update the local information about all the remote branches. If you only want to pull/fetch the information for a single remote branch, you need to specify it.