Git, Genome Browser and sparse-checkout

12 views
Skip to first unread message

Lachlan Musicman

unread,
Apr 14, 2015, 11:36:43 AM4/14/15
to genome...@soe.ucsc.edu
Hey

I wanted to do a git sparse checkout of the src/hg/htdocs folder so
that we can make some adjustments to the web facing portion of the
genome-browser, but I'm getting this error:

git pull origin beta
error: Unable to find 3a2f5bace9562b5a17aa28217e93d814935583b9 under
http://genome-source.cse.ucsc.edu/kent.git
Cannot obtain needed blob 3a2f5bace9562b5a17aa28217e93d814935583b9
while processing commit 5ec0f8e22e458d6d7b07446c46d84f547e3cb445.

I tried this suggested solution:

git fsck
notice: HEAD points to an unborn branch (master)
Checking object directories: 100% (256/256), done.
notice: No default references
dangling commit 8c870021f64c9da33352d10ecd96c415483f41b6
dangling commit cfed687cd99e9b0501dad789801af2b766eba222

git gc
Nothing new to pack.

but got no better result.

The set up of the local repository was done as follows:

mkdir modc-gb
cd modc-gb/
git init
git config core.sparsecheckout true
git remote add origin http://genome-source.cse.ucsc.edu/kent.git
echo src/hg/htdocs/ >> .git/info/sparse-checkout

I pulled on the beta because this page:
ftp://hgdownload.cse.ucsc.edu/apache/htdocs-rr/admin/git.html
suggests that it's the branch to use.

Then I saw that the same page suggests:

git checkout -t -b beta origin/beta
fatal: Cannot update paths and switch to branch 'beta' at the same time.
Did you intend to checkout 'origin/beta' which can not be resolved as commit?


git remote update
Fetching origin
error: Unable to find 8310f8c08246de85f04be3baefc46d8842bf681d under
http://genome-source.cse.ucsc.edu/kent.git
Cannot obtain needed object 8310f8c08246de85f04be3baefc46d8842bf681d
error: Fetch failed.
error: Could not fetch origin


git fetch origin
error: Unable to find 8310f8c08246de85f04be3baefc46d8842bf681d under
http://genome-source.cse.ucsc.edu/kent.git
Cannot obtain needed object 8310f8c08246de85f04be3baefc46d8842bf681d
error: Fetch failed.



any suggested solutions or tips appreciated

Cheers
L.

------

I'm treading carefully
but it's the time of night
the snowy light
the subway roar
and the whispered fights
exciting sights
but it's not enough
I thought it was
I wish it was
I thought it was
-----
You name it - The Cannanes with Explosion Robinson.
https://youtu.be/MGrillKAzsI

Jonathan Casper

unread,
Apr 16, 2015, 7:44:12 PM4/16/15
to Lachlan Musicman, genome...@soe.ucsc.edu

Hello Lachlan,

Thank you for your question about using git's sparse-checkout option to retrieve part of the kent repository. I'm not sure how you arrived at the "git pull" error messages - I followed the same process to create a local repository, and "git pull origin beta" worked just fine for me. The subsequent "git checkout -t -b beta origin/beta" gives me the same error that it gives you, but that's not a big surprise. The original "git pull" tried to bring part of the remote beta branch into your current local branch, which is probably titled master (you can try running "git branch" to confirm that). The -b flag to git checkout tells git that you want to create a new local branch and switch to it, but that's not compatible with updating paths. Thus, git gets confused.

You can try to set tracking information for your sparse repository with "git branch --set-upstream master origin/beta" (followed by git pull), but that may not be enough to fix whatever is broken with your repository. You might need to first run "git fetch" (or run the original "git remote add" with the -f option to perform a fetch) so that the branch information is available. If that does not help, we recommend that you either start from scratch and just check out the full repository, or else consult a different list for git technical support.

I hope this is helpful. If you have any further questions, please reply to gen...@soe.ucsc.edu or genome...@soe.ucsc.edu. Questions sent to those addresses will be archived in publicly-accessible forums for the benefit of other users. If your question contains sensitive data, you may send it instead to genom...@soe.ucsc.edu.

--
Jonathan Casper
UCSC Genome Bioinformatics Group



--


Lachlan Musicman

unread,
Apr 20, 2015, 7:35:29 PM4/20/15
to Jonathan Casper, genome...@soe.ucsc.edu
Thanks Johathan,

Appreciated. I went straight for the restart and it worked fine.

Cheers
L.
------

I'm treading carefully
but it's the time of night
the snowy light
the subway roar
and the whispered fights
exciting sights
but it's not enough
I thought it was
I wish it was
I thought it was
-----
You name it - The Cannanes with Explosion Robinson.


Reply all
Reply to author
Forward
0 new messages