Also note that the example uses main as branch name, but depending on your version of Git this might still be master for you.Īgain, if that does not work (of if it’s asking for login) you might want to look into this guide by Github for adding SSH keys. It will then give you the following commands under ’ …or push an existing repository from the command line’: git remote add origin :sebsel/test.gitĮspecially the first line is important, because the Git Obsidian plugin and the Github Desktop app can manage the rest. If you add the repository on Github too, you can coose ‘New’ and then leave all checkmarks unchecked under ‘Initialize this repository with’. It does nothing to your actual files.)įrom here, you can just use Github Desktop by pointing it to your Vault (‘add existing repository’). This will create a Git Repository inside your Vault. Now that you’re in your Vault, you can type git init. If you run the command ls you will see all your files and/or folders. You are now in your Vault in the Terminal. Go to the Terminal again and type cd /Users/seb/notes (with your own Vault path). That’s the location of you Vault you need. If you copy that part with SSD, it will paste like this: /Users/seb/notes. This will give info about the file (hence the I) and will show ‘Where’ under ‘General’. Go to your Vault in Finder and press Cmd+I on any of the files. Type git and hit enter to make sure macOS indeed came with git. This is a preinstalled standard Mac app, which is probably easiest to find by using Spotlight and searching for Terminal. On Mac, for a new or existing Vault, I would do the following: So, yes, I’m not smart enough to translate all this back to a non-terminal using guide, sorry about that. I would just use git init when I’m in the Vault in the terminal. This is a nice way to avoid the Terminal, but it makes me lose track of what’s going on. There is a step about viewing hidden files, but I don’t know if that’s really a prerequisite? On Mac, I always hide and show files by changing the true and false in the following Terminal command (which I have aliased):ĭefaults write AppleShowAllFiles -bool true & killall Finder (There is also this guide specific to Github Desktop, but I think that will authenticate GhDesktop and not Git Obsidian.) I myself use SSH keys, see this guide by Github, which can be a bit advanced, and uses the Terminal again. There is this step that says git config -global credential.helper wincred, and that will probaby not work for Mac. This is a nice program for beginners with Git, and there is a Mac version too, so while you can skip the installation of Git itself, this Github Desktop program is still a nice one to have. Under the software installation step there is also a link to install Github desktop. If you don’t, everyone can read your Vault on the Github site. If you want your Vault to be private, create a private repo on Github. Github is a nice service though, I use it too. You can use other hubs (like Gitlab) or none at all. As the name suggests: Github is a hub for those who use Git. You don’t actually need an account on Github to use Git. You will see something like the screenshot with the black background in the guide: $ git You can confirm this by opening the application called ‘Terminal’ and type the word git, followed by an enter. With that in mind, you can just follow the linked guide and skip the software installation step. Other options are Homebrew, like I mentioned, or see this page for more installation options. You can also run xcode-select -install to install them. If you follow the steps I describe next, it might say something about installing the XCode Command Line Developer Tools. → It turns out that macOS does not come with Git preinstalled. I have installed a newer version through Homebrew, but I think the preinstalled version works just fine for most users who want to use the Obsidian Git plugin. To my knowledge, macOS comes with Git preinstalled.
0 Comments
Leave a Reply. |