配置可攜程式環境 <<
Previous Next >> 靜態 CMSimfly
倉儲改版
建立 Git 倉儲, 並 clone 倉儲至近端工作後, 對遠端倉儲改版
可攜程式系統中已經內建 git, 可以在啟動 start.bat 後, 透過 path 的設定, 直接執行 git 指令.
建立 Git 倉儲, 共分為兩類, 一類是直接在 Github 網際介面下建立倉儲時, 要求建立 README.md 檔案, 之後可以直接在近端, 以 git clone 加上倉儲連線 URL, 將倉儲克隆一份到近端, 並以最新版本作為工作目錄, 使用者改版後, 可以直接透過 git add, commit 與 push 對遠端倉儲改版.
另一類則是故意在 Github 網際介面下建立倉儲時, 不要建立任何檔案, 而是在近端自行利用 git 指令建立倉儲架構, 新增內容後, 以 git remote add 設法在近端倉儲中納入 origin URL 後, 將近端倉儲版本新增提交推送到遠端.
git add
git add 可以用來新增一個檔案, 數個檔案, 或在之前提交後所新增的所有內容.
git add 在 GIT 架構下, 是對所新增或修改的內容拍快照:
git add . adds all modified and new (untracked) files in the current directory and all subdirectories to the staging area (a.k.a. the index), thus preparing them to be included in the next git commit . Any files matching the patterns in the .gitignore file will be ignored by git add
git commit
git commit 執行之前, 必須使用 git config 建立臨時或永久的身分註記, 因為 GIT 在展開所有改版內容時, 必須明確登錄這些變更的作者與時間.
當使用者採用 git commit -m "改版說明訊息", 此次提交到 .git 目錄下的更動內容, 均會綁定使用者身分與改版所輸入的說明訊息.
git push
git push 在隨後沒有輸入遠端 URL 代號時, 表示要推送到 origin, 若透過 git remote add 設定其他代號與 URL 對應時, git push 加上代號, 就可以將此次的提交內容, 推送到指定的 URL 所在遠端倉儲.
我的blogger文章:https://40723210.blogspot.com/2019/05/blog-post_21.html
操作流程和影片:
1.先登入自己的github帳號。
2.創建一個新的倉儲repositories。
3.git clone https://github.com/s40723210/40723210 。
4.進入要存放該資料的資料夾tmp。
5.開啟倉儲設定,點選要推送的branch。
6.進入該倉儲資料夾,開始更新或變動。
7.git status > git add . > git commit -m "標題" > git push。
★git指令可參照簡介內的重點筆記
我的教學影片:https://youtu.be/QBcUQYGy554
我的blogger文章:https://40723210.blogspot.com/2019/04/ssh-keygit-clone-git-push.html
使用ssh key來進行git clone 與git push:
1.先把git config --edit --system裡面的helper = manager刪除後輸入:wq(是儲存後退出)。
2.進入控制台>使用者帳戶>認證管理員>windows認證>刪除現存的github帳號。
3.輸入ssh-keygen -t rsa -b 4096 -C "github的email"。
4.輸入你想存放的位子例如:Y:\home\.ssh/id_rsa。
5.一直案Enter到結束。
6.打開id_rsa並且全部複製>進入setting>SSH and GPG keys 。
7.案New ssh key 貼上>輸入想要的名子儲存。
★vi指令可參照簡介內的重點筆記
我的教學影片:https://youtu.be/SJHMm3o5uEw
配置可攜程式環境 <<
Previous Next >> 靜態 CMSimfly