obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

Question: How do I change branches? The drop down menu doesn't include newly created ones?

Open ReaderGuy42 opened this issue 4 years ago • 8 comments

I created a new branch on github for my repo, but even when I restart Obsidian it doesn't show up in the drop down menu. Am I missing a step?

I finally got the push & pull to work smoothly, but I'm really not very knowledgeable on git at all, so I apologize if it's obvious.

Thanks :)

ReaderGuy42 avatar Oct 30 '21 10:10 ReaderGuy42

The branch is only on GitHub and not on your local system. How and why did you create it on GitHub?

Vinzent03 avatar Oct 30 '21 18:10 Vinzent03

In the repo I click on the main button to the top left of the files. Then it asks if I want to create a new branch. I thought this would be a good idea to have multiple versions in case something goes wrong. Or does github do that automatically? Thanks :)

ReaderGuy42 avatar Oct 30 '21 18:10 ReaderGuy42

Since GitHub is a hub for git, it's all based on commits, so you don't have to create a new branch, since you can just revert a bad commit.

Edit: Do you know the concept of git like commits and remotes in general?

Vinzent03 avatar Oct 30 '21 19:10 Vinzent03

I have somewhat succesfully set up the plugin, and just now followed this tutorial to encrypt my repo-vault.

But no I don't really know much beyond the tutorials, not even sure what a commit is haha

Edit: the impeimentation of git-crypt did NOT work lol so I'll just go back to un-encrypted, i guess

ReaderGuy42 avatar Oct 30 '21 21:10 ReaderGuy42

I suggest you to learn a bit more about git. But a commit is basically a snapshot of all your files. Every time you want to push your current files to GitHub, you create a new commit, which is based on the previous commit. If something goes wrong, you can reset/revert that commit. You don't need an extra branch.

Vinzent03 avatar Oct 31 '21 11:10 Vinzent03

Ok, thanks, that's a good idea. Are there any plans of making git-crypt available for the plugin?

ReaderGuy42 avatar Oct 31 '21 12:10 ReaderGuy42

@Vinzent03 I do have a use case for branches based on the hub. Contributors (those added to the organisation with write access to the hub) can push to different branches for different changes we are working on. Having a drop down menu to switch branches would be great.

argenos avatar Nov 01 '21 12:11 argenos

@argenos there is already a setting that allows you to switch branches. It's in Settings > Obsidian Git > Current branch.

denolehov avatar Nov 01 '21 12:11 denolehov