Closed ArchangeGabriel closed 5 years ago
git doesn't work like this, you cannot pull (a subtree) from a repository without any commits. This was fixed by 2d4274caf25d61aa4ef6faa761a991ce216989ba (by aborting with a helpful error) but I never pushed a new package to [community]...
OK, I wanted to avoid commiting anything, seems that won’t be possible.
You could commit a README.md, your first new PKGBUILD, a .gitignore... :)
Don’t need a README, I have no new PKGBUILD, and don’t need a .gitignore. :p OK maybe the */**/ one for vcs package actually (for anything else, I actually want git to tell me I have those untracked files around).
I was starting anew to get rid of old the old packages staying in the git history, I’m trying a git filter-tree approach and wanted to compare to starting from scratch.
git doesn't work like this, you cannot pull from a repository without any commits.
Let me pedantic for a second and clarify this as it isn't 100% true.
git init
git pull https://github.com/eli-schwartz/aurpublish/
git
will gladly fetch and merge the default remote branch into your unborn branch master
. Resulting in your local master
becoming whatever the default branch in the remote is. (Or any branch you pass as a second parameter to git pull).
However, the contrib/ git-subtree
script used by aurpublish
isn't as nice with this edge case.
git init
git subtree add --prefix somesubtree https://github.com/eli-schwartz/aurpublish master
Will fail with complaints that it can't figure it out what HEAD is. Due to the fact it isn't handling the unborn branch case. (Does it make sense to add a subtree if the parent tree doesn't exist in the first place?)
But as Eli mentioned, it's easier to just get around it by committing something else first.
@ArchangeGabriel
Don’t need a README, I have no new PKGBUILD, and don’t need a .gitignore.
Not sure if it helps at all, but yet another option is to just add a dummy commit with: git commit --allow-empty
.
Did not know about the ability to do an empty commit, that would work to, yes. Thanks!
To repro:
This results in: