Hi, After loading org-git-link.el, 'C-c l' ('org-store-link') fails for file in $HOME but not under Git, such as "~/foo.c". The following is contents of the *Backtrace* buffer while the error happens. I have attached a patch to fix this issue. Debugger entered--Lisp error: (wrong-type-argument stringp nil) directory-file-name(nil) (file-name-directory (directory-file-name dirpath)) (let ((dirname (file-name-directory (directory-file-name dirpath))) (basename (file-name-nondirectory (directory-file-name dirpath)))) (list dirname basename)) org-git-split-dirpath(nil) (let ((dirlist (org-git-split-dirpath dir))) (if (string= (nth 1 dirlist) "") (progn (throw (quote toplevel) nil))) (setq dir (nth 0 dirlist) relpath (concat (file-name-as-directory (nth 1 dirlist)) relpath))) (while (not (file-exists-p (expand-file-name ".git" dir))) (let ((dirlist (org-git-split-dirpath dir))) (if (string= (nth 1 dirlist) "") (progn (throw (quote toplevel) nil))) (setq dir (nth 0 dirlist) relpath (concat (file-name-as-directory (nth 1 dirlist)) relpath)))) (catch (quote toplevel) (while (not (file-exists-p (expand-file-name ".git" dir))) (let ((dirlist (org-git-split-dirpath dir))) (if (string= (nth 1 dirlist) "") (progn (throw (quote toplevel) nil))) (setq dir (nth 0 dirlist) relpath (concat (file-name-as-directory (nth 1 dirlist)) relpath)))) (list (expand-file-name ".git" dir) relpath)) (let ((dir (file-name-directory path)) (relpath (file-name-nondirectory path))) (catch (quote toplevel) (while (not (file-exists-p (expand-file-name ".git" dir))) (let ((dirlist (org-git-split-dirpath dir))) (if (string= (nth 1 dirlist) "") (progn (throw (quote toplevel) nil))) (setq dir (nth 0 dirlist) relpath (concat (file-name-as-directory (nth 1 dirlist)) relpath)))) (list (expand-file-name ".git" dir) relpath))) org-git-gitrepos-p("~/foo.c") (if (org-git-gitrepos-p file) (progn (org-store-link-props :type "git" :link (org-git-create-git-link file line)))) (let ((file (abbreviate-file-name (buffer-file-name))) (line (line-number-at-pos))) (if (org-git-gitrepos-p file) (progn (org-store-link-props :type "git" :link (org-git-create-git-link file line))))) (progn (let ((file (abbreviate-file-name (buffer-file-name))) (line (line-number-at-pos))) (if (org-git-gitrepos-p file) (progn (org-store-link-props :type "git" :link (org-git-create-git-link file line)))))) (if (buffer-file-name) (progn (let ((file (abbreviate-file-name (buffer-file-name))) (line (line-number-at-pos))) (if (org-git-gitrepos-p file) (progn (org-store-link-props :type "git" :link (org-git-create-git-link file line))))))) org-git-store-link() #[257 "\300. \205\f..B\211\262.\207" [nil] 4 "\n\n(fn F)"](org-git-store-link) mapcar(#[257 "\300. \205\f..B\211\262.\207" [nil] 4 "\n\n(fn F)"] (org-git-store-link org-rmail-store-link org-mhe-store-link org-irc-store-link org-info-store-link org-gnus-store-link org-docview-store-link org-bibtex-store-link org-bbdb-store-link org-w3m-store-link org-notmuch-search-store-link org-notmuch-store-link org-eww-store-link org-man-store-link)) org-store-link(nil) funcall-interactively(org-store-link nil) call-interactively(org-store-link nil nil) command-execute(org-store-link) Emacs : GNU Emacs 25.2.1 (x86_64-apple-darwin16.4.0, Carbon Version 157 AppKit 1504.81) of 2017-04-26 Package: Org mode version 9.0.7 (release_9.0.7-493-g82a503 @ /Users/xcy/src/org-mode/lisp/)