時間格式化
timeFilter(time) {
const dt = new Date(time);
const y = dt.getFullYear();
const m = (dt.getMonth() + 1).toString().padStart(2, '0');
const d = dt.getDate().toString().padStart(2, '0');
const hh = dt.getHours().toString().padStart(2, '0');
const mm = dt.getMinutes().toString().padStart(2, '0');
const ss = dt.getSeconds().toString().padStart(2, '0');
return `${y}-${m}-$bcfq5i4 ${hh}:${mm}:${ss}`;
}
托管項目到線上倉庫
- 基本使用方法
- 使用
git init
初始化本地項目
- 使用
touch README.md
和 touch .gitignore
來創(chuàng)建項目的說明文件和忽略文件
- 使用
git add .
將所有文件托管到git中
- 使用
git commit -m "init project"
將項目進行本地提交
- 使用
git remote add origin "倉庫地址(SSH)"
將本地項目和遠程倉儲連接庶骄,并使用origin
作為遠程倉庫的別名
- 使用
git push -u origin master/或者別名
將本地代碼push到倉儲中
git中常用的分支命令
-
git checkout -b 分支名稱
在當前的分支上使用-b
創(chuàng)建一個子分支八孝,并立即使用checkout
切換到子分支
-
git branch 分支名稱
是單純的創(chuàng)建一個子分支
-
git checkout 分支名稱
切換分支
- 在
master
分支上绅络,運行git merge 子分支名稱
渔彰,就表示把子分支上所有的功能代碼合并到主分支
-
git status
查看狀態(tài)
-
git add .
添加到暫存區(qū)
-
git commit -m '想提交的消息'
提交到本地存儲中
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者