建立github倉庫的gh pages分支

2022-02-01 23:54:24 字數 598 閱讀 7471

git symbolic-ref命令將當前工作分支由master切換到乙個尚不存在的分支gh-pages。

$ git symbolic-ref head refs/heads/gh-pages
刪除暫存區檔案,即相當於清空暫存區。

$ rm .git/index
建立專案首頁index.html

$ printf "hello world.\n" > index.html
新增檔案index.html到暫存區。

$ git add index.html
執行提交。提交完畢分支gh-pages完成建立。

$ git commit -m "branch gh-pages init"
執行推送命令,在github遠端版本庫建立分支gh-pages。

$ git push -u origin gh-pages

建立github倉庫

第一次提交的過程 1.首先在 上面建立github倉庫。2.進入到你本地工程目錄下面,開啟git bash 3.首先初始化本地倉庫,在git bash中輸入 git init 4.其次新增所有的本地檔案到本地倉庫的索引中 git add 5.從本地索引中提交到本地倉庫 git commit m 這是...

GitHub建立倉庫

0.本地安裝git 直接跳到第三步,使用下面命令更加方便 ssh keygen t rsa c 478377515 qq.com enter cd ls al cd ssh cat id rsa.pub 開啟id rsa.pub中檔案之後,複製 之後進行第四步操作 驗證 ssh t git gith...

使用Shell建立GitHub倉庫

使用shell建立github倉庫 github的 倉庫分為2種型別 使用者自己的 倉庫 組織的 倉庫 下面就使用shell指令碼建立這2種型別的 倉庫,指令碼如下 建立使用者自己的 倉庫 bin bashuser name your username project name project na...