https://lakefs.io/ logo
Title
b

Brendan Miller

05/07/2023, 12:23 AM
Really basic lakefs question: How do I copy or rename a branch? I’ve tried using
lakectl branch create <lakefs://dataset/new_branch> --source <lakefs://dataset/old_branch>
I would expect this to create a copy of the old branch. Instead, it seems to create a new branch which is empty. If I point my application at the new branch it can’t find any data in it. I’m brand new to lakefs, so maybe I’m not understanding some basic concept here. I assumed it worked like git, where if you branched off of an existing branch, the new branch would have identical contents to the old one initially. Instead it seems like they start off empty?
n

Niro

05/07/2023, 12:31 AM
Hi @Brendan Miller , welcome to the lake! :lakefs: When you create a new branch, the source branch given is used to provide as the base for the new branch. It means the new branch will contain all the commits the source branch had at that point and as a result all the data the commits hold. Silly question: did you commit the data you uploaded to the source branch before you created the new branch?
b

Brendan Miller

05/07/2023, 12:49 AM
No, it looks like the branch I’m basing it off of has files within it, but no commits. Ok, that makes sense. Again, completely new to lakefs.
Thanks for the pointer
n

Niro

05/07/2023, 12:52 AM
No problem! This is one of those differences between lakeFS and Git that might be confusing at first. Since there's no concept of local and remote, staging is done directly to the object store ("remote") so when listing the branch the objects are there, but not yet committed. Hope you enjoy lakeFS, feel free to engage if you have additional questions!
👍 1