在github gist上添加圖片

在github gist上添加圖片

前言

github不說了吧,談談gist,引用wiki一段話(注意紅色字體): git

GitHub also operates other services: a pastebin-style site called Gist[8] that provides wikis for individual repositories and web pages that can be edited through a Git repository

有時就須要給gist上傳一些圖片,在看看github gist上提供的: github

貌似就沒打算讓咱們上傳圖片嘛!像咱們這種追求完美的程序猿,怎麼也沒法逃避那顆騷動的心!咱就要圖文並茂,怎麼辦?·「如有更好辦法,歡迎指點」 web

三步箴言:

第一步:建立gist, 記住ID

github上建立本身的gist,例如我建立的:https://gist.github.com/walkingnine/6199161, ID即爲 6199161 shell

第二步:使用ssh方式:clone gist

git clone git@github.com:ID.git
例如個人:

git clone git@github.com:6199161.git

若是你和我開始同樣,不幸使用了https, 並且官網也提供了, ssh

看到這個樂壞了吧,趕快使用 ide

git clone https://gist.github.com/6199161.git
慶幸的是你成功的clone下來了,不幸的是使用
git push origin master
會出現:
Username for 'https://gist.github.com': walkingnine@gmail.com
Password for 'https://walkingnine@gmail.com@gist.github.com': 
error: RPC failed; result=55, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
弄了這麼多了,感情就出來這個,對得起嗎?不信?試試看。仍是使用ssh吧,騷年。

第三步:大功告成

這時你能夠在gist項目中添加本身的圖片或者文件等,而後使用git add/commit命令,最後: 字體

git push origin master  # master is the branch, you may use your own branch.
刷刷網頁,再看看,腫麼樣,圖片就華麗麗的出如今你那迷人的雙眼裏。
相關文章
相關標籤/搜索