Posts

Showing posts from February, 2016

git 刪除 commit (before/after push), 刪除 remote folder, 強制 push

早上用 swift 寫了個 new feature, 想要放到 github 上, 但是遇到幾個老問題, 這裡記錄一下。 1. 上傳時忽略不必要或者敏感的 files, folder 利用 .gitignore (但他似乎沒能達到需求) 2. 步驟 1 失敗了時, 該怎麼辦 git rm -r --cached NOT_UPLOAD_FOLDER 3. 如何利用 rebase 移除不必要的 commit ***  等等,先記得備份檔案到別處!  *** >git log  先查詢想要移除的 commits 的前一個 commit_code >git rebase -i [commit_code] 這指令會列出想要修正的 commit, 直接刪除不需要的commits >git rebase --continue 運氣好的話(沒有conflict)可以直接做 rebase >git status 這表示發生 conflict 了, 查一下需要修改哪些檔案 How-to-resolve-conflict 這連結給了解決的一些方式, 我是直接 git add 解決... lol 4. 如何強制更新 remote branch 這裡是因為 3 是 local 的 rebase,  github 上仍是存在  commit, 導致 push 失敗。 *** 等等,你真的知道這在幹嘛嗎 *** >git push origin master --force

一週一記事

Image
ELM, 另一種 functional language, 是說一直沒能有機會接觸這語言,今天看到 meetup 有人開團,可惜時間是一般日,還是先上網做點功課,有興趣再去好了。 quora 上有人分享心得可以參考。 jupyter, 這是在更新 ipython 到 4.0 時因為缺少這元件, 才發現 iPython 在 2015年8月時有了重大的更新, 除了讓 iPython 脫離 python-centric 的刻板印象外,亦支援其他語顏,做到更 language-agnostic 的 interactive programming。 【原文】  Exclusive – Bloomberg Head of Data Science Gideon Mann Talks Machine Learning and Financial Data Gideon Mann, Head of Data Scientist at BloomBerg. incrunchdata News 對他的採訪, 有兩個方向    what they are focusing on in their current roles    what their interest are outside of data. 1. which of your skills do you find most relevant for success as Head of Data Science?  要成為 effective data scientist 必須具備三項   a. skill to apply techniques to utilize data   b. deep knowledge of mathematics   c. ability to listen (most important since the solution to problem is often deeply rooted in the question itself) 2. what does the first hour of your work day usually look like? how do you prioritize your biggest

git 時不同帳戶,不同專案的管理

【緣由】原先 laptop 上都是自己的 github account, 可因為前陣子也因為需要開新 account 用來 clone 了公司的 project, 於是修改了設定。導致早上要 submit 自己的東西到自己的 github 時卻發現 account 是公司的. 這花了不少時間理解,決定還是筆記一下。 Host work.github.com HostName github.com User WORK_GITHUB_USERNAME PreferredAuthentications publickey IdentityFile ~/.ssh/id_work_rsa IdentitiesOnly yes Host personal.github.com HostName github.com User PERSONAL_GITHUB_USERNAME PreferredAuthentications publickey IdentityFile ~/.ssh/id_personal_rsa IdentitiesOnly yes (1) 首先,修改 ~/.ssh/config, 增加各自的設定 (參考上例). HOST 的 [url] 只是接下來幫你找到該設定,怎麼填並無太大關係。 $ git config user.name "John Doe" $ git config user.email johndoe@example.com (2) 接著, 設定 local repository 的帳號密碼 。很重要!因為我就耗在這裡... orz  之前就是沒改這個部分,直接跳 (3)  後,submit 的仍是公司 account... [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git@personal.github.com:PERSONAL_GITHUB_USERNAME/project.git (3) 修改 .git/config 的 url,