snipt

Ctrl+h for KB shortcuts

Bash

Install a new Git repo

1
2
3
4
# add this to your .bash_profile
# usage: gitinstall http://github.com/path/to/git.git

function gitinstall(){ git init; git remote add origin "$@"; git config branch.master.remote origin; git config branch.master.merge refs/heads/master; git pull;}
https://snipt.net/embed/9517cb33519115158749a04f0dfe8758/
https://snipt.net/raw/9517cb33519115158749a04f0dfe8758/
9517cb33519115158749a04f0dfe8758
bash
Bash
4
2016-09-28T04:15:20
True
False
False
/api/public/snipt/25561/
install-a-new-git-repo
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c"># add this to your .bash_profile</span> </span><span id="L-2"><a name="L-2"></a><span class="c"># usage: gitinstall http://github.com/path/to/git.git</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="k">function</span> gitinstall<span class="o">(){</span> git init<span class="p">;</span> git remote add origin <span class="s2">&quot;</span><span class="nv">$@</span><span class="s2">&quot;</span><span class="p">;</span> git config branch.master.remote origin<span class="p">;</span> git config branch.master.merge refs/heads/master<span class="p">;</span> git pull<span class="p">;</span><span class="o">}</span> </span></pre></div> </td></tr></table>
bash, git, install, setup
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.