常用命令

1.retrace error log

Proguard wants each “at” on a separate line, and only with white space before it. If it sees anything but white space before the at, it will not unobfuscate it.

每行以at 开头,前面只能有空格,不能有其他。

/Users/samzhao/Documents/adt-bundle-mac-x86_64-20131030/sdk/tools/proguard/bin/retrace.sh -verbose mapping.txt 1.txt

2.让gitignore 起作用

Even if you haven’t tracked the files so far, git seems to be able to “know” about them even after you add them to .gitignore.
A quick fix that I’ve used was to run the following commands from the top folder of your git repo:

git rm -r --cached .

Followed by:

git add .

and

git commit -m "fixed untracked files"

3.让git不跟踪文件的变化

git update-index --assume-unchanged <file>

4.git 出现 fatal: The remote end hung up unexpectedly

git config http.postBuffer 524288000

5.git 命令参考

git - 简明指南

http://git-scm.com/docs

建立本站遇到的问题及解决方法

1. hexo 安装出现 Warning “root” does not have permission to access the dev dir 的解决办法

添加 --unsafe-perm

具体如下:

sudo npm install --unsafe-perm --verbose -g hexo

2. Upgrade NodeJS to the latest version on Mac os

Here’s how I successfully upgraded from v0.8.18 to v0.10.20 without any other requirements like brew etc, (type these commands in terminal):

  • sudo npm cache clean -f clear you npm cache
  • sudo npm install -g n install “n” (this might take a while)
  • sudo n stable upgrade to lastest version

Note that sudo might prompt your password.

If the version number doesn’t show up when typing node -v, you might have to reboot.

参考来源

3. 部署到github 上的问题

采用hexo deploy -g部署时,如果是从github的备份blog 拉下来的话,项目里不包含.deploy目录,如果部署的话,会生成新的.deploy目录,.deploy目录中包含.git目录,这样部署会清空远程仓库,再把public整个放到github 上,效率太低。

两种办法解决

  • 只在一个地方部署,在其他地方更新blog 备份。
  • 如果在多个地方部署的话,如下:
1
2
3
4
5
6
7
zhao:BlogBackup zhaosam$ cd .deploy/
zhao:.deploy zhaosam$
zhao:.deploy zhaosam$ git pull
From https://github.com/Reacoder/Reacoder.github.io
* branch master -> FETCH_HEAD
Already up-to-date.
zhao:.deploy zhaosam$
  • 如果是第一次,就新建.deploy目录,然后克隆部署过的blog,如:git clone https://github.com/Reacoder/Reacoder.github.io再执行第二步。

4. 拷贝blog 备份需要再次运行npm install

1
2
3
4
server:~ samzhao$ hexo init tt
[info] Copying data
[info] You are almost done! Don't forget to run `npm install` before you start blogging with Hexo!
server:~ samzhao$