1. 1BUG
    2. root@bfire:~/geeknote# geeknote login
    3. >>> : Authorize...Traceback (most recent call last):
    4. File "/usr/local/lib/python2.7/dist-packages/geeknote-0.2a-py2.7.egg/geeknote/geeknote.py", line 883, in main
    5. User().login(**ARGS)
    6. File "/usr/local/lib/python2.7/dist-packages/geeknote-0.2a-py2.7.egg/geeknote/geeknote.py", line 35, in wrapper
    7. return func(*args, **kwargs)
    8. File "/usr/local/lib/python2.7/dist-packages/geeknote-0.2a-py2.7.egg/geeknote/geeknote.py", line 397, in login
    9. if self.getEvernote().auth():
    10. File "/usr/local/lib/python2.7/dist-packages/geeknote-0.2a-py2.7.egg/geeknote/geeknote.py", line 151, in auth
    11. self.authToken = GNA.getToken()
    12. File "/usr/local/lib/python2.7/dist-packages/geeknote-0.2a-py2.7.egg/geeknote/oauth.py", line 132, in getToken
    13. self.getTmpOAuthToken()
    14. File "/usr/local/lib/python2.7/dist-packages/geeknote-0.2a-py2.7.egg/geeknote/oauth.py", line 150, in getTmpOAuthToken
    15. oauth_callback="https://" + self.url['base']
    16. File "/usr/local/lib/python2.7/dist-packages/geeknote-0.2a-py2.7.egg/geeknote/oauth.py", line 103, in loadPage
    17. conn.request(method, uri, params, headers)
    18. File "/usr/lib/python2.7/httplib.py", line 962, in request
    19. self._send_request(method, url, body, headers)
    20. File "/usr/lib/python2.7/httplib.py", line 996, in _send_request
    21. self.endheaders(body)
    22. File "/usr/lib/python2.7/httplib.py", line 958, in endheaders
    23. self._send_output(message_body)
    24. File "/usr/lib/python2.7/httplib.py", line 818, in _send_output
    25. self.send(msg)
    26. File "/usr/lib/python2.7/httplib.py", line 780, in send
    27. self.connect()
    28. File "/usr/lib/python2.7/httplib.py", line 1165, in connect
    29. self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
    30. File "/usr/lib/python2.7/ssl.py", line 381, in wrap_socket
    31. ciphers=ciphers)
    32. File "/usr/lib/python2.7/ssl.py", line 143, in __init__
    33. self.do_handshake()
    34. File "/usr/lib/python2.7/ssl.py", line 305, in do_handshake
    35. self._sslobj.do_handshake()
    36. error: [Errno 104] Connection reset by peer
    37. http://git-scm.com/docs/git-log
    38. 02、解决git bashvim 中文乱码问题
    39. 1vim的,直接修改git自带的vim下的vimrc配置文件即可。
    40. git安装目录\share\vim\vimrc 文件中加入:
    41. set fileencodings=utf-8,ucs-bom,cp936,big5
    42. set fileencoding=utf-8
    43. set termencoding=gbk
    44. 2. 编辑 git-completion.bash 文件:$ vi git-completion.bash
    45. 最下面添加
    46. alias ls='ls --show-control-chars --color=auto' #ls能够正常显示中文
    47. 3. 编辑 inputrc 文件:$ vi inputrc
    48. 修改 output-meta convert-meta 属性值
    49. set output-meta on #bash中可以正常输入中文
    50. set convert-meta off
    51. 4. 编辑 profile 文件:$ vi profile
    52. 最下面添加
    53. export LESSHARSET=utf-8
    54. 5. 重新编译配置文件,使文件生效
    55. $ source git-completion.bash
    56. $ source inputrc
    57. $ source profile
    58. 03error: failed to push some refs to 'git@github.com:archermind/LEDTorch.apk-for-Android.git'
    59. http://like-eagle.iteye.com/blog/1742246
    60. 1、注册github账号并创建仓库。
    61. 注册好帐号,比如我的用户名是liweiyitou
    62. 创建一个新的仓库(Repository),例如theone
    63. 2、将工程文件夹(比如theone)拷贝至C:\Sites\下
    64. 3、执行git命令提交代码至Github
    65. git init
    66. git add .
    67. git commit -m "first" -a
    68. git remote add origin https://github.com/liweiyitou/theone.git
    69. git push origin master
    70. ###在之后git控制台提示中继续再输入github的用户名和密码即可push代码成功哦\(^o^)/~
    71. 解释:
    72. 在当前目录初始化
    73. 添加所有文件
    74. 提交,first是提交时的注释
    75. 要把网址换为你建立的Repository的网址,github网站上能查到
    76. pushgithub
    77. =========================================
    78. 代码冲突"! [rejected] master -> master (non-fast-forward)"的原因以及解决办法:
    79. ①博文选摘之一
    80. 如下文章选摘自博文:http://blog.csdn.net/mci2004/article/details/7763399
    81. 最近想把自己做的一个小小小小的应用放到github上去,顺便学习下git和玩玩github,我用两台电脑往github上的项目push代码,想模拟social coding的感觉。呵呵,但是出现了这个错误
    82. To git@github.com:archermind/LEDTorch.apk-for-Android.git
    83. ! [rejected] master -> master (non-fast-forward)
    84. error: failed to push some refs to 'git@github.com:archermind/LEDTorch.apk-for-Android.git'
    85. To prevent you from losing history, non-fast-forward updates were rejected
    86. Merge the remote changes before pushing again. See the 'Note about
    87. fast-forwards' section of 'git push --help' for details.
    88. 错误产生的原因是,因为我在A电脑上向github上的项目push过代码,而又在B电脑上修改了代码并且要pushgithub上去,这个时候,git为了避免冲突的发生,rejected
    89. 正确的做法是,在push之前git fetch origin,将github上的新代码拉下来,然后在本地merge,如果没有冲突就可以push了,如果有冲突的话要在本地解决冲突后,再push。具体做法就是。
    90. git fetch origin
    91. git merge origin/master
    92. ###这两步其实可以简化为git pull origin master
    93. git push origin master
    94. ②博文选摘之二
    95. Git错误non-fast-forward后的冲突解决
    96. 博文转载:http://blog.csdn.net/chain2012/article/details/7476493
    97. 当要push代码到git时,出现提示:
    98. error:failed to push some refs to ...
    99. Dealing with "non-fast-forward" errors
    100. From time to time you may encounter this error while pushing:
    101. $ git push origin master
    102. To ../remote/
    103. ! [rejected] master -> master (non-fast forward)
    104. error: failed to push some refs to '../remote/'
    105. To prevent you from losing history, non-fast-forward updates were rejected
    106. Merge the remote changes before pushing again. See the 'non-fast forward'
    107. section of 'git push --help' for details.
    108. This error can be a bit overwhelming at first, do not fear. Simply put, git cannot make the change on the remote without losing commits, so it refuses the push. Usually this is caused by another user pushing to the same branch. You can remedy this by fetching and merging the remote branch, or using pull to perform both at once.
    109. In other cases this error is a result of destructive changes made locally by using commands like git commit --amend or git rebase. While you can override the remote by adding --force to the push command, you should only do so if you are absolutely certain this is what you want to do. Force-pushes can cause issues for other users that have fetched the remote branch, and is considered bad practice. When in doubt, don't force-push.
    110. 问题(Non-fast-forward)的出现原因在于:git仓库中已经有一部分代码,所以它不允许你直接把你的代码覆盖上去。于是你有2个选择方式:
    111. 1,强推,即利用强覆盖方式用你本地的代码替代git仓库内的内容
    112. git push -f
    113. 2,先把git的东西fetch到你本地然后merge后再push
    114. $ git fetch
    115. $ git merge
    116. 这2句命令等价于
    117. $ git pull
    118. 可是,这时候又出现了如下的问题:
    119. 上面出现的 [branch "master"]是需要明确(.git/config)如下的内容
    120. [branch "master"]
    121. remote = origin
    122. merge = refs/heads/master
    123. 这等于告诉git2件事:
    124. 1,当你处于master branch, 默认的remote就是origin。
    125. 2,当你在master branch上使用git pull时,没有指定remote和branch,那么git就会采用默认的remote(也就是origin)来merge在master branch上所有的改变
    126. 如果不想或者不会编辑config文件的话,可以在bush上输入如下命令行:
    127. $ git config branch.master.remote origin
    128. $ git config branch.master.merge refs/heads/master
    129. 之后再重新git pull下。最后git push你的代码吧。it works now~
    130. 4\git lab Permission denied 错误解决方案
    131. 使用git clone工程的时候,遇到以下错误
    132. Shell代码 收藏代码
    133. [user@host ~]$ git clone user@gitlab.xx.com:projectname/proj.git
    134. Cloning into itemcenter-all...
    135. user@gitlab.xx.com's password:
    136. Permission denied, please try again.
    137. user@gitlab.xx.com's password:
    138. Permission denied, please try again.
    139. user@gitlab.xx.com's password:
    140. Permission denied (publickey,password,keyboard-interactive).
    141. fatal: The remote end hung up unexpectedly
    142. 经过查阅发现是ssh模式不支持 用户名+密码 验证,需要调整gitlab服务器ssh配置。
    143. Shell代码 收藏代码
    144. vi /etc/ssh/sshd_config
    145. #修改这一行
    146. #PasswordAuthentication no
    147. PasswordAuthentication yes
    148. 也可以客户端使用http模式绕过
    149. Shell代码 收藏代码
    150. [user@host ~]$ git clone http://gitlab.xx.com/projectname/proj.git