今天主要在教Git
其實在進入Git之前還講解了IOS的一些推薦使用軟體
- iTerm2 命令列視窗 : https://www.iterm2.com/ <= 比原本的終端機還要潮~
- Sublime Text 程式編碼器:http://www.sublimetext.com/3
- Sourcetree 管理Git : https://www.sourcetreeapp.com/
- Slack 團隊通訊軟體: https://slack.com/downloads
其實 Git 在台大上課時就已經使用過
但是說真的對他還是很陌生
下面整理一下今天的筆記
以下是 Github 上的教學
- echo "# test" >> README.md
- git init *建立一個目錄,隱藏的.git資料夾
- git add README.md * 新增一個 README檔案
--------到目前檔案在本機的staging area-------- - git commit -m "first commit」 *對於這次的上傳做註記
--------到目前檔案在本機的repository-------- - git remote add origin git@github.com:stevenchentw/test.git 」
*與遠端的位置做連結, 使用 SSH 傳送 - git push -u origin master
--------將檔案上傳到github裡面--------
如果你是第二次要上傳請享用
- git add .
- git commit -m 「 xxxxx,xxxx"
- git push
- 如果發生錯誤, 請看以下:
error: failed to push some refs to 'https://github.com/stevenchentw/helloworld.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
這代表你遠端資料已經被修改, 請先使用git pull 拉下來後再push
但是事情絕對沒有這麼簡單
衝突有幾種
1. 遠端檔案數量跟本機端數量不一樣(差一點只有檔案數量)
恭喜~這時候比較簡單, 把檔案pull下來之後,再push就好了
2. 但如果是檔案內文不一樣, 請先打開該檔案,
修改之後再add=>commit=>push.
備註:
* README.md :為記錄你每次修改的 commit
第一週的最後一堂課, 基本上是在做下週課程的準備
透過基本的 ruby 語法進行邏輯運算
安裝程式
教導Git 基本操作
Startup的基本觀念
如何pitch~
如何pitch~
在下篇 會整理這第一週的所有重點~
0 意見:
張貼留言