File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848* ` public void onStop() `
4949 * 当onStop返回的时候,fragment将从屏幕上消失。
5050
51+ * ` public void onDestoryView() `
52+ * 该方法的调用意味着在 `onCreateView` 中创建的视图都将被移除。
53+
5154* ` public void onDestroy() `
5255 * Android在Fragment不再使用时会调用该方法,要注意的是~这时Fragment还和Activity藕断丝连!并且可以获得Fragment对象,但无法对获得的Fragment进行任何操作(呵~呵呵~我已经不听你的了)。
5356
Original file line number Diff line number Diff line change 1+ # Git 操作
2+
3+ ## git 命令
4+
5+ * 创建本地仓库
6+
7+ ```
8+ git init
9+ ```
10+
11+ * 获取远程仓库
12+
13+ ```
14+ git clone [url]
15+ 例:git clone https://github.com/you/yourpro.git
16+ ```
17+
18+ * 创建远程仓库
19+
20+ ```
21+ // 添加一个新的 remote 远程仓库
22+ git remote add [remote-name] [url]
23+ 例:git remote add origin https://github.com/you/yourpro.git
24+ origin:相当于该远程仓库的别名
25+
26+ // 列出所有 remote 的别名
27+ git remote
28+
29+ // 列出所有 remote 的 url
30+ git remote -v
31+
32+ // 删除一个 renote
33+ git remote rm [name]
34+
35+ // 重命名 remote
36+ git remote rename [old-name] [new-name]
37+ ```
38+
39+ * 从本地仓库中删除
40+
41+ ```
42+ git rm file.txt // 从版本库中移除,删除文件
43+ git rm file.txt -cached // 从版本库中移除,不删除原始文件
44+ git rm -r xxx // 从版本库中删除指定文件夹
45+ ```
46+
47+ * 从本地仓库中添加新的文件
48+
49+ ```
50+ git add . // 添加所有文件
51+ git add file.txt // 添加指定文件
52+ ```
53+
54+ * 提交,把缓存内容提交到 HEAD 里
55+
56+ ```
57+ git commit -m "注释"
58+ ```
59+
60+ * 撤销
61+
62+ ```
63+ // 撤销最近的一个提交.
64+ git revert HEAD
65+
66+ // 取消 commit + add
67+ git reset --mixed
68+
69+ // 取消 commit
70+ git reset --soft
71+
72+ // 取消 commit + add + local working
73+ git reset --hard
74+ ```
75+
76+ * 把本地提交 push 到远程服务器
77+
78+ ```
79+ git push [remote-name] [loca-branch]:[remote-branch]
80+ 例:git push origin master:master
81+ ```
82+
83+ * 查看状态
84+
85+ ```
86+ git status
87+ ```
88+
89+ * 从远程库中下载新的改动
90+
91+ ```
92+ git fetch [remote-name]/[branch]
93+ ```
94+
95+ * 合并下载的改动到分支
96+
97+ ```
98+ git merge [remote-name]/[branch]
99+ ```
100+
101+ * 从远程库中下载新的改动
102+
103+ ```
104+ pull = fetch + merge
105+
106+ git pull [remote-name] [branch]
107+ 例:git pull origin master
108+ ```
109+
110+ * 分支
111+
112+ ```
113+ // 列出分支
114+ git branch
115+
116+ // 创建一个新的分支
117+ git branch (branch-name)
118+
119+ // 删除一个分支
120+ git branch -d (branch-nam)
121+
122+ // 删除 remote 的分支
123+ git push (remote-name) :(remote-branch)
124+ ```
125+
126+ * 切换分支
127+
128+ ```
129+ // 切换到一个分支
130+ git checkout [branch-name]
131+
132+ // 创建并切换到该分支
133+ git checkout -b [branch-name]
134+ ```
135+
136+ ## gitignore
137+ ---
138+
139+ 在本地仓库根目录创建 .gitignore 文件。Win7 下不能直接创建,可以创建 ".gitignore." 文件,后面的标点自动被忽略;
140+
141+ ```
142+ /.idea // 过滤指定文件夹
143+ /fd/* // 忽略根目录下的 /fd/ 目录的全部内容;
144+ *.iml // 过滤指定的所有文件
145+ !.gitignore // 不忽略该文件
146+ ```
147+
Original file line number Diff line number Diff line change 1+ #查漏补缺
2+ ---
3+
4+ 请分析一张400* 500尺寸的PNG图片加载到程序中占用内存中的大小
5+
6+ [ http://m.blog.csdn.net/article/details?id=7856519 ] ( http://m.blog.csdn.net/article/details?id=7856519 )
You can’t perform that action at this time.
0 commit comments