git本地配置及IDEA下Git合并部分文件

开源 0

目录

1、IDEA 下 Git 合并部分文件

2、分支合并忽略特定文件步骤

3、git本地配置


1、IDEA 下 Git 合并部分文件

1.1Git 下存在两个分支,foo 和 bar 分支,想要把 bar 分支上的部分文件合并到 foo 分支:
首先切换到 foo 分支,点击右下角的 git:foo 标签按钮,
选择菜单中 Local Branches 的 bar 分支,选择 Show Diff with Work Tree,
在弹出的窗口中,选择自己需要拉取的文件,对着右键选择 Get From Branch就完成

1.2可以在不同分支的提交记录上使用git的cherry-Pick选项选择记录合并到ide当前打开分支上

2、分支合并忽略特定文件步骤

在项目根目录下新建文件.gitattributes,然后文件中写入需要忽略的文件名 + merge=ours, 一个文件占一行 例:
忽略config.xml 文件
config.xml merge=ours
如果设置了没有起效,在根目录下运行命令行 git config merge.ours.driver true 进行config配置

问题:SSL certificate problem: self signed certificate
git config --global http.sslVerify false

3、git本地配置

1.查看本地配置
git config --list
2.配置用户名
git config --global user.name 用户名
3.配置邮箱
git config --global user.email 邮箱
4.配置密码
git config --global credential.helper store
git config credential.helper store
git config --unset credential.helper
5.打开任意一个项目,执行git pull 或者git push操作
6.按照提示输入账户密码,以后就不需要再输入了。

也许您对下面的内容还感兴趣: