zoukankan      html  css  js  c++  java
  • Git:与eclipse搭配使用

    Git:与eclipse搭配使用

    1)工程初始化为本地库

    工程 ——》右键 ——》Team ——Share Project

    在该目录下创建了本地库

    这里可以设置用户签名

    2)Eclipse中忽略文件

    Navigator可以很清楚的看清文件目录层次

    1)概念:Eclipse中特定文件

    这些都是Eclipse为了管理我们创建的工程而维护的文件,和我们开发的代码没有直接关系,最好不要在git中进行追踪,也就是把他们忽略

    .classpath文件

    .project文件

    .settings目录下所有文件

    2)为什么要忽略Eclipse特定文件呢

    因为在同一个团队中,大家用的Eclipse版本可能不一样

    3)配置忽略文件

    GitHub官网样例文件

    https://github.com/github/gitignore

    https://github.com/github/gitignore/blob/master/java.gitignore

    # Compiled class file
    *.class
    
    # Log file
    *.log
    
    # BlueJ files
    *.ctxt
    
    # Mobile Tools for Java (J2ME)
    .mtj.tmp/
    
    # Package Files #
    *.jar
    *.war
    *.nar
    *.ear
    *.zip
    *.tar.gz
    *.rar
    
    # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
    hs_err_pid*
    官方推荐

    在用户~目录下  .gitconfig为全局配置文件

    我们自己定义一个文件来存放忽略配置

    # Compiled class file
    *.class
    
    # Log file
    *.log
    
    # BlueJ files
    *.ctxt
    
    # Mobile Tools for Java (J2ME)
    .mtj.tmp/
    
    # Package Files #
    *.jar
    *.war
    *.nar
    *.ear
    *.zip
    *.tar.gz
    *.rar
    
    # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
    hs_err_pid*
    
    .classpath
    .project
    .settings
    target

    在 .gitconfig 目录下配置

    [user]
        name = 用户名
        email = 邮箱
    [core]
        excludesfile = 绝对正确的路径,用/斜线

    重启eclipse生效  restart

    3)推送到远程库

    Add all Branches Spec

    4)克隆工程到eclipse

    如果是maven工程目录需要转化一下,右键工程

     5)冲突时的比较

    6)创建分支

    7)切换分支审查代码

     8)合并分支

  • 相关阅读:
    学习java annotation
    自己模拟实现spring IOC原理
    ubuntu16.04~qt 5.8无法输入中文
    尔雅小助手
    ubuntu16.04 python3 安装selenium及环境配置
    A flash of Joy
    数据库大作业--由python+flask
    flask+html selected 根据后台数据设定默认值
    mysql--sqlalchemy.exc.IntegrityError: (IntegrityError) (1215, 'Cannot add foreign key constraint'
    SQL Server 2014连接不到服务器解决方法
  • 原文地址:https://www.cnblogs.com/it-taosir/p/10012993.html
Copyright © 2011-2022 走看看