Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Another trick is to use an independent branch, checked out in a subtree of your project, as Junio Hamano (the current Git maintainer) does with Git's <a href="http://repo.or.cz/w/git.git/shortlog/refs/heads/todo" rel="noreferrer">todo</a>. Cookbook:</p> <pre><code>$ cd project/ $ git branch * master $ git init META </code></pre> <p>You can now create your “To Do list” and other files in <code>META/</code></p> <pre><code>$ cd META/ $ echo '* Item 1' &gt; todo.org $ git add todo.org $ git commit -m 'Initial version of TODO file' [master (root-commit) 64748ba] Initial version of TODO file 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 todo.org </code></pre> <p>Let's change the branch name to <code>meta</code>, too, and push it back to the main repository:</p> <pre><code>$ git branch -m meta $ git push .. meta </code></pre> <p><em>You will have to remember to push the branch back after each commit; setting up a post-commit hook may be in order.</em></p> <p><code>META/</code> now shows up as an untracked file in the main repository; let's ignore it locally:</p> <pre><code>$ cd .. $ git status # (Shows META/ as untracked) $ echo META/ &gt;&gt; .git/info/exclude </code></pre> <p>You can now switch branches at will, and <code>META/</code> will stay untouched—as long as the branch you are switching to does not include a conflicting path, of course.</p> <p>The main repository now contains an additional, totally independent branch, which can be pushed and pulled as any other part of your project:</p> <pre><code>$ git branch * master meta $ gitk --all </code></pre> <p><img src="https://i.imgur.com/8CXzh.png" alt="Screenshot"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload