T019 GitHub 2020
T019 GitHub 2020
1. Introduction
1.1. Pre‐Requirement
T000_018_GitForWindows_2020
Tutorial 018: Git for Windows 下載與安裝(2020 April)
1.2. Software that you might need
Step 1
Install Git
You need Git environment for your computer
‐‐‐‐‐‐‐‐‐‐‐‐
安裝 Git
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Step 2:
Register a Git server
Git server is a place which store your source code.
‐‐‐‐‐‐‐‐‐‐‐‐
註冊 Git server
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Step 3:
Install graphical user interface (GUI)
Some people might not be familiar with Git command.
In this case, they may use some kind of GUI for Git
GUI allow users to click some buttons,
then GUI will execute the correspond Git command.
‐‐‐‐‐‐‐‐‐‐‐‐
GUI 允許使用者只需要按下幾個按鈕
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Step 4:
Install GUI/Visual Merge Tool
When your team member and you are changing the same files,
you might have to merge 2 changes of the same files from 2 different people.
It is always hard to do merge,
so GUI/Visual Merge Tool might help you compare the different of 2 changes
then make you easier to do Merge.
‐‐‐‐‐‐‐‐‐‐‐‐
安裝 Merge 的圖形介面工具軟體
你可能會需要 Merge 兩人的修改部分
Merge 其實是很難的
所以 Merge 的圖形介面工具軟體 可以幫助你 比較兩人的修改部分
讓你更容易執行 Merge
‐‐>
Here, we are going to do Step 2
2. GitHub Price
This is the price that I saw in May 2020.
Go to
https://github.com/pricing#feature‐comparison
1.
GitHub Actions
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
1.1.
Reference:
A.
GitHub Actions: How to Set Up a Simple Workflow
https://youtu.be/F3wZTDmHCFA
B.
Github Actions 初探
https://juejin.im/post/5c417da751882525c63809cd
C.
About GitHub Actions
https://help.github.com/en/actions/getting‐started‐with‐github‐actions/about‐github‐
actions
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
1.2.
In Brief, You may write some custom tasks, called GitHub Actions,
to help you automatically set up in your repository
to build, test, package, release, or deploy any code project on GitHub.
‐‐‐‐‐‐
幫助你自動化你的 repository 的設定
甚至 你還可以設定自動 release, or deploy
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
2.
GitHub Packages storage
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
2.1.
Reference:
About GitHub Packages
https://help.github.com/en/packages/publishing‐and‐managing‐packages/about‐github‐
packages
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
2.2.
A "package" is kind of a self‐contained and reusable piece of codes
such as common framework for developing a project.
You can publish some GitHub packages
in a public repository (public packages)
to share with all of GitHub,
or in a private repository (private packages)
to share with collaborators or an organization.
GitHub Packages usage is free for public packages.
For private packages,
each GitHub account receives a certain amount of
free storage and data transfer.
The storage is GitHub Packages storage
which is like the size limit of your GitHub Packages.
‐‐‐‐‐‐
並且 reusable (可重複使用的) 的 一段程式碼
你也可以發行一些 私人的 GitHub package 給 你的同事和公司使用
公開的 GitHub package 並沒有
針對 Storage ( package 所占用的空間大小 ) 做限制
但是
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
3.
For most project, the free account will be good enough.
You may pay additional fee if you want to get additional GitHub feature.
‐‐‐‐‐‐
對大部分的情況來說
免費帳號已經很夠用了
但是如果你覺得免費的不夠用
你還是可以交錢購買更多的功能
3. Register GitHub
Go to
https://github.com/
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Click "Sign Up"
It will go to
https://github.com/join?source=header‐home
‐‐>
Fill up your username, email and your password
‐‐>
Click "Verify"
Ensure you follow the instruction to complete the verify process
‐‐‐‐‐‐‐‐‐‐‐‐‐
按下"Sign Up"
會跑到
https://github.com/join?source=header‐home
填入你的 username, email 和 password
按下"Verify"
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
If you didn't complete your verify process,
then you have to do it again.
‐‐‐‐‐‐‐‐‐‐‐‐‐
如果你沒有完成 verify
那他會讓你重新做一次
If you can complete your verify process in time
Just click "Create Account" to
‐‐‐‐‐‐‐‐‐‐‐‐‐
如果你完成了一定時間內完成了 verify
就可以按下 Create Account 了
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Github will provide a short survey, please complete it.
‐‐‐‐‐‐‐‐‐‐‐‐‐
Github 會讓你做一個簡短的問卷
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
GitHub will request you to verify your email,
In this case, you have to check your email
and follow the instruction to verify your email.
‐‐‐‐‐‐‐‐‐‐‐‐‐
請你去收一下 email
In your email, Click "Verify email address".
It will go to
https://github.com/join/get‐started
https://github.com/join/get‐started
4. GitHub Settings
4.1. GitHub change Email
Go to
https://github.com/
On top right, click your picture,
‐‐> Settings
‐‐‐‐‐‐‐‐‐‐
如果你想要換你帳號的 email
就去 https://github.com/
在右上角你的照片那邊
選取
Settings
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Click "Emails" tab
‐‐>
If you want to change your GitHub email...
‐‐>
Firstly, you have to enter your new email
in "add email address" and then click "Add"
‐‐>
Go to "Primary Email Address" and
set your new email as your Primary email address.
‐‐>
On top area
Delete your old email.
‐‐‐‐‐‐‐‐‐‐
左邊選取 Email tab
如果你想要換你帳號的 email
首先
你需要新增你新的 email 在
"add email address"
接著
去"Primary Email Address"
然後在最上方
刪除你舊的 email
‐‐>
If you changed your email
Please ensure your new email will get the "Notifications"
‐‐‐‐‐‐‐‐‐‐
當你改變你的 email
記得也要去"Notifications"
改變你接收"Notifications" 的 email
4.2. GitHub Email Privacy
1.
By default,
It will select the
Keep my email addresses private
and
un‐select
Block command line pushes that expose my email
‐‐‐‐‐‐‐‐‐‐‐‐‐
預設情況下
會勾選
Keep my email addresses private
但不會勾選
Block command line pushes that expose my email
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
2.
Keep my email addresses private
When you perform "Merge and Edit", GitHub will not display your email
‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
3.
Block command line pushes that expose my email
When you commit to Git,
the commit will record your email.
In this case,
GitHub will display your email.
If you select this option,
GitHub will prevent you to commit by your private email
in order to hide your private email.
Some people will use other email to commit in order to hide their private email.
In my case,
I don't mind to show my email when commit.
Thus, I un‐select this option.
‐‐‐‐‐‐‐‐‐‐‐‐‐
這種情況下
如果你勾選了此選項
這樣就可以隱藏住你私人 email
這樣就可以隱藏住私人 email
以我的情況來說
所以我會 "不勾選"此選項
5. GitHub GitHub
5.1. GitHub Create Repo
Your Photo ‐‐> Right Click
‐‐>
Your Repositories
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
你的照片
按下右鍵
選取
"Your Repositories"
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
New
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
按下"New"
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Repository name :
gitdemo
‐‐>
Description (optional) :
a git demo 用來練習使用 GitHub
‐‐>
public
‐‐>
Select
Initialize this repository with a README
‐‐>
Add .gitignore:
VisualStudio
‐‐>
Add a license:
MIT License
‐‐>
Create Repository
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
It will go to the following page
https://github.com/gitithandyguytw/gitdemo
5.2. GitHub Repo, Git Clone Information
1.
Go to
https://github.com/
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
先去
https://github.com/
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
2.
Your Photo ‐‐> Right Click
‐‐>
Your Repositories
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
你的照片
按下右鍵
選取
"Your Repositories"
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Select
"gitdemo"
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
選取
"gitdemo"
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Press "Clone or download"
Copy the HTTPS URL
This is for Git Clone
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
按下 "Clone or download"
並且複製
HTTPS URL
這些資料是為了 Git Clone
5.3. GitHub Delete Repo
If you want to delete your Repository
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
In your repo page
‐‐>
Go to Setting Tab
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
點選"Settings"
scroll down
You will see the "delete this repository" button
Here you may delete your repo
I just want to show you how to delete the repo.
Please don't delete now
‐‐‐‐‐‐‐‐
往下拉
你將會看到"delete this repository"按鈕
這邊你可以刪除 repo
我只是想讓你知道如何刪除 repo
但是請你先不要刪除 repo