-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
86 lines (84 loc) · 5.24 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>How To Deploy a Static Website on GitHub</h1>
<p>
<h2>Initial Deployment</h2>
<ol>
<li>Install git on my computer (Need to do this only once, type git to check if it already exists)/li>
<li>Create a new repository as public and check the optional "Add README" so that we start with one file as an indicator</li>
<li>Press green Code button then copy the URL (http as default)</li>
<li>...GithubPages % <code>git clone https://github.com/fcoder/superninja.git</code>, this creates a superninjia directory</li>
<li>cd superninja, then open vscode</li>
<li>Add new file index.html, type 'doc' to create a newget a template of HTML, add this instruction as the html body</li>
<li><code>git status</code> to check, see new file index.html and main branch</li>
<li><code>git add .</code></li>
<li><code>git commit -m "Initial commit"</code></li>
<li><code>git remote -v</code> to check the name of the remote repository</li>
<li><code>git branch</code> to check the name of local git branch</li>
<li><code>git push origin main</code> Now see new file index.html in the Github superjinjia repo</li>
<li>Click on Settings on the top right corner, click on Pages on the left pane. Click
<a href="img/github_pages_settings.png">HERE</a> to see the screenshot
</li>
<li>See Source sub-section, press the pulldown menu with initial value None, change it to 'main', which is the default branch to deploy</li>
<li>Keep the code as root, press the Save button</li>
<li>Now under GitHub Pages we should see a URL for our project deployed at Github</li>
</ol>
</p>
<h2>About Updates</h2>
<ul>
<li><b>Update in Current Branch:</b>Just modify, add or delete files, then do <code>git add, git commit</code> and <code>git push</code>,<br>
the website at github is updated with the newly pushed code</li>
<li><b>Create a New Branch Then Push To Github:</b>Will see new branch in github in addition to previous branches,<br>
need to select the new branch for deployment in the Github Pages of the github repository.<br>
See <a href="https://www.youtube.com/watch?v=QyFcl_Fba-k">https://www.youtube.com/watch?v=QyFcl_Fba-k</a> for details.
</li>
</ul>
</p>
<hr>
<h2>Create a Local Repo then Push to GitHub</h2>
<p><pre>
logon to github, create a new repository for receving new code from local system. Do not check README, that will
require a pull first! Let's say the URL for the new repo is https://github.com/aphexes/csscheatsheet.git
cd to the root of local new repo
git init To initialize git for current app, will create a .git directory
ls -a Check if .git has been created, which contain all the git programs and data
git status git should detect our local directories and code as untracked
git add . Add current code for git to start manage
git status git should show our local app files in green color, ready to be committed
got commit -m "css tutorial initial commit" Commit the local app to local git for version control
git remote add origin https://github.com/aphexes/csscheatsheet.git Connect local git with remote github repo as "origin"
git remote -v To check if the newly added origin does point to the correct github repo
git branch Check branch name of local repo
git branch -M main If the default branch name is master, rename it to main for political correctness. Need to do this only once
git push -u origin main To push local "main" repo upstream to github repo "origin"
</pre></p>
<hr>
<h2>Add A Collabrator</h2>
<p>
<pre>
Login to the repository to be shared
Click on Settings
Clicks on Collabrator
Add the github name of the person who you want to invite to be your collaborator
Press the button to invite
Need his accaptance
</pre>
Then follow <a href="https://medium.com/@jonathanmines/the-ultimate-github-collaboration-guide-df816e98fb67#:~:text=If%20you're%20a%20collaborator,Github%20Repo%20with%20your%20teammates.&text=And%20now%20you're%20ready%20to%20collaborate!">this instruction</a> to collabrator.<br>
<pre>
The important part of this instruction is as follows,
If you’re a collaborator, go to the Github Repo page, Git Clone the project, and cd into the directory. Don’t fork it! Forking
will copy it in a new Repo to your Github page, but you don’t want that — you want to collaborate on the same Github Repo with
your teammates.
$ git clone [email protected]:MinesJA/github_guide.git
$ cd github_guide/
And now you’re ready to collaborate!
</pre>
</p>
</body>
</html>