Skip to content

Commit

Permalink
deploy: 47e1804
Browse files Browse the repository at this point in the history
  • Loading branch information
amyheather committed Jun 5, 2024
1 parent ab76d25 commit 9134e5c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions _sources/programming_notes/git.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ Git will give warning for file over 50MB and block file over 100MB. However, you
* Can then git add and commit that file
* Recommended that you also add the .gitattributes file produced

## Tags

Tag an old release: `git tag tagname commit` e.g. `git tag v0.1.0 f94e8f6`

Push tag to remote: `git push origin v0.1.0`

View date of tag (i.e. date of commit that was tagged): `git log -1 --format=%ai v0.1.0`

## Git fetch v.s. git pull
`git fetch` downloads remote data, but doesn't integrate it with your files - it gives you a fresh view but is totally "harmless", won't affect local stuff.
`git pull` updates your local files with changes from the remote server, integrating it with the working copies of your files (and will try to merge remote changes in merge conflicts) - so should not do this when you have uncommitted local changes.
Expand Down
7 changes: 7 additions & 0 deletions programming_notes/git.html
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,12 @@ <h2>Track large file<a class="headerlink" href="#track-large-file" title="Permal
<li><p>Recommended that you also add the .gitattributes file produced</p></li>
</ul>
</div>
<div class="section" id="tags">
<h2>Tags<a class="headerlink" href="#tags" title="Permalink to this heading">#</a></h2>
<p>Tag an old release: <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">tag</span> <span class="pre">tagname</span> <span class="pre">commit</span></code> e.g. <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">tag</span> <span class="pre">v0.1.0</span> <span class="pre">f94e8f6</span></code></p>
<p>Push tag to remote: <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">push</span> <span class="pre">origin</span> <span class="pre">v0.1.0</span></code></p>
<p>View date of tag (i.e. date of commit that was tagged): <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">log</span> <span class="pre">-1</span> <span class="pre">--format=%ai</span> <span class="pre">v0.1.0</span></code></p>
</div>
<div class="section" id="git-fetch-v-s-git-pull">
<h2>Git fetch v.s. git pull<a class="headerlink" href="#git-fetch-v-s-git-pull" title="Permalink to this heading">#</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">fetch</span></code> downloads remote data, but doesn’t integrate it with your files - it gives you a fresh view but is totally “harmless”, won’t affect local stuff.<br />
Expand Down Expand Up @@ -633,6 +639,7 @@ <h2>Public v.s. private repositories<a class="headerlink" href="#public-v-s-priv
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#add-rename-remove-push">Add, rename, remove, push</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#undo-git-command">Undo git command</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#track-large-file">Track large file</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#tags">Tags</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#git-fetch-v-s-git-pull">Git fetch v.s. git pull</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#branches-and-versions">Branches and versions</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#git-stash">Git stash</a></li>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 9134e5c

Please sign in to comment.