/
clone_repo.erb
24 lines (24 loc) · 918 Bytes
/
clone_repo.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<% repo_url = "git@#{request.host}:#{h params[:repo_name]}.git" %>
<div id="repository-details">
<h3>Congratulations! Your repository was added!</h3>
<p>
If you have an existing local git repository you wish to push, try...
</p>
<code> cd your-repo
git remote add origin <%= repo_url %>
git push origin master<%= " --force" if params[:made_empty] == "yes" %></code>
<p>
Otherwise, to initialize an empty repository:
</p>
<% if params[:made_empty] == "yes" %>
<code>git clone <%= repo_url %></code>
<% else %><code> mkdir your-repo
cd your-repo
git init
touch .gitignore
git add .gitignore
git commit -m "Added blank .gitignore to initialize repository"
git remote add origin <%= repo_url %>
git push origin master</code><% end %>
<p>And you should be good to go! <a href="#" onclick="$('#repository-details').slideUp(); return false;">(close instructions)</a></p>
</div>