周记 2016.4.17

1. 往Github上提交代码,如何解决failed to push some refs to git:

    1). 此时很多人会尝试下面的命令把当前分支代码上传到master分支上。$ git push -u origin master 但依然没能解决问题

    2). 出现错误的主要原因是github中的README.md文件不在本地代码目录中。可以通过如下命令进行代码合并【注:pull=fetch+merge]

         git pull --rebase origin master

         执行上面代码后可以看到本地代码库中多了README.md文件

    3). 此时再执行语句 git push -u origin master即可完成代码上传到github

         参考:http://jingyan.baidu.com/article/f3e34a12a25bc8f5ea65354a.html?st=2&net_type=&bd_page_type=1&os=0&rst=&word=chegji@gmail.com

2. 添加远程库

    1). git init

    2). git remote add origin git@github.com:michaelliao/learngit.git

    3). git push -u origin master

    参考:http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0013752340242354807e192f02a44359908df8a5643103a000

3. 可以利用spring加载properties配置文件。spring配置文件中加载properties配置文件:

    <context:property-placeholder location="classpath:server.properties" />

    代码中可以通过value配置,获取参数值:

    @Value("${unclaim.interval}")

     private int unClaimInterval;

     对于map类型的参数,需要在properties文件中配置成:message.templates={store_join:"加盟",store_pass:"通过"} 类型。注入时,使用 @Value("#{${message.templates}}") 的格式

4. 使用jenkins部署项目,可以通过 Console Output查看部署日志。在tomcat的catlina.out中可以查看项目部署到tomcat中时的日志。

原文地址:https://www.cnblogs.com/Jtianlin/p/5501730.html