idea中如何配置git以及在idea中初始化git呢:

参考此博文:

http://blog.csdn.net/qq_28867949/article/details/73012300

*为了这个问题折腾了半天...在这里记录下,方便大参考,欢迎评论提出宝贵意见,谢谢!**

问题说明:

解决方法一:

◆打开IDEA,按照路径  Fie--》Settings --》 Tools --》Terminal 找到后设置右边的Shell path(自己安装的Git路径下相对位置),如下图所示



不完美之处:当我们点击idea中的Terminal终端时,会自动弹出Windows安装的bash窗口,如下图所示:

解决方法二:

◆更改路径即可
git\bin\bash.exe
或 Git\bin\sh.exe
然后重新启动idea即可


 

********************88注意:每次更改完成后需要重新启动IDEA******************

=============================记录End=============================

git在idea中使用:

(1)创建README.md文件

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ touch README.md

(2)创建.gitignore文件(用于忽略上传的文件)

#提交到码云上面忽略的东西配置

*.class
#package file
*.war
*.ear
*.orig target/
.settings/
.project
.classpath .idea/
/idea/
*.ipr
*.iml
*.iws *.log
*.cache
*.diff
*.patch
*.tmp .DS_Store
Thumbs.db

  

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ touch .gitignore

(3)初始化git

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)

$ git init
Initialized empty Git repository in F:/workspace/imallproject/.git/

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)

查看git状态:现在是在master上(一般分支开发主干合并)
$ git status
On branch master

(4)commit提示错误,先git add一下

Initial commit

Untracked files:
(use "git add <file>..." to include in what will be committed)

.gitignore
README.md
pom.xml
src/

nothing added to commit but untracked files present (use "git add" to track)

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ git add .

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ git status
On branch master

Initial commit

Changes to be committed:
(use "git rm --cached <file>..." to unstage)

new file: .gitignore
new file: README.md
new file: pom.xml
new file: src/main/webapp/WEB-INF/web.xml
new file: src/main/webapp/index.jsp

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ git commit -am 'first commit '
[master (root-commit) 5ef0663] first commit
5 files changed, 65 insertions(+)
create mode 100644 .gitignore
create mode 100644 README.md
create mode 100644 pom.xml
create mode 100644 src/main/webapp/WEB-INF/web.xml
create mode 100644 src/main/webapp/index.jsp

git连接到码云仓库:

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ git remote add origin git@git.oschina.net:marrymayun/imalllearning.git

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ git branch
* master

(5)推送

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ git push -u origin master
The authenticity of host 'git.oschina.net (120.55.226.24)' can't be established.
ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ git pull
The authenticity of host 'git.oschina.net (120.55.226.24)' can't be established.
ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'git.oschina.net,120.55.226.24' (ECDSA) to the list of known hosts.
warning: no common commits
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
From git.oschina.net:marrymayun/imalllearning
* [new branch] master -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> master

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ git push -u -f origin master
Counting objects: 11, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (11/11), 1.29 KiB | 0 bytes/s, done.
Total 11 (delta 0), reused 0 (delta 0)
To git@git.oschina.net:marrymayun/imalllearning.git
+ a5a27d2...5ef0663 master -> master (forced update)
Branch master set up to track remote branch master from origin.

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ git branch
* master

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ git branch -r
origin/master

在master下创建分支v1.0

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)
$ git checkout -b v1.0 origin/master
Branch v1.0 set up to track remote branch master from origin.
Switched to a new branch 'v1.0'

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (v1.0)
$ git branch
master
* v1.0

推送到分支,我们在分支开发,主干合并

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (v1.0)
$ git push origin HEAD -u
Total 0 (delta 0), reused 0 (delta 0)
To git@git.oschina.net:marrymayun/imalllearning.git
* [new branch] HEAD -> v1.0
Branch v1.0 set up to track remote branch v1.0 from origin.

fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (v1.0)
$

完成:

至此在idea中初始化git完成。

idea中如何配置git以及在idea中初始化git的更多相关文章

  1. J2EE进阶(五)Spring在web.xml中的配置

     J2EE进阶(五)Spring在web.xml中的配置 前言 在实际项目中spring的配置文件applicationcontext.xml是通过spring提供的加载机制自动加载到容器中.在web ...

  2. 3、带你一步一步学习ASP.NET Core中的配置之Configuration

    如果你是刚接触ASP.NET Core的学习的话,你会注意到:在ASP.NET Core项目中,看不到.NET Fraemwork时代中的web.config文件和app.config文件了.那么你肯 ...

  3. Bear 實驗室: 什麼是Git flow ? 如何在SourceTree使用Git flow管理開發!

      http://www.takobear.tw/12/post/2014/02/bear-git-flow-sourcetreegit-flow.html     Bear 實驗室: 什麼是Git ...

  4. [转]git在eclipse中的配置

    一_安装EGIT插件 http://download.eclipse.org/egit/updates/ 或者使用Eclipse Marketplace,搜索EGit 二_使用EGIT前的配置 配置个 ...

  5. 【转】git在eclipse中的配置

    原文网址:http://www.cnblogs.com/zhxiaomiao/archive/2013/05/16/3081148.html 一_安装EGIT插件 http://download.ec ...

  6. git在eclipse中的配置 转载

    git在eclipse中的配置 转载 一_安装EGIT插件 http://download.eclipse.org/egit/updates/ 或者使用Eclipse Marketplace,搜索EG ...

  7. 使用Homebrew安装Git与Github在idea中的配置

    系统环境:macOS 10.13.4 一.Homebrew的安装 linux系统有个让人蛋疼的通病,软件包依赖,好在当前主流的两大发行版本都自带了解决方案,Red hat有yum,Ubuntu有apt ...

  8. Git在eclipse中的配置

    1:git在eclipse中的配置 windows - >preferences->team->git->configuration 点击add Entry key值:输入 u ...

  9. Git在Xcode中的配置与使用常见问题总结

    书接上回提出的Git在Xcode中的配置与使用常见问题4个问题 问题1,如何在Xcode中创建代码库,并添加和提交代码到代码库? 问题2,如何在Xcode中提交推送给远程服务器代码库? 问题3,如何在 ...

随机推荐

  1. Using ARR to setup a proxy

    Install IIS Install ARR 3.0 from WebPI Open IIS management console (inetmgr), select the server node ...

  2. python2.7入门---字符串

        这次咱们就来看一下python的字符串类型.首先我们要知道,字符串是 Python 中最常用的数据类型.我们可以使用引号('或")来创建字符串.创建字符串很简单,只要为变量分配一个值 ...

  3. VGA 时序标准

    VGA 显示器扫描方式从屏幕左上角一点开始,从左像右逐点扫描,每扫描完一行,电子束回到屏幕的左边下一行的起始位置,在这期间,CRT 对电子束进行消隐,每行结束时,用行同步信号进行同步:当扫描完所有的行 ...

  4. 【转载】[Elasticsearch]ES入门

    传送门:http://www.cnblogs.com/xing901022 ES即简单又复杂,你可以快速的实现全文检索,又需要了解复杂的REST API.本篇就通过一些简单的搜索命令,帮助你理解ES的 ...

  5. 【Consul】Consul架构-Consensus协议

    Consul使用Consensus协议提供一致性(Consistency)--CAP定义的一致性.Consensus协议是基于"Raft:In search of an Understand ...

  6. 使用uniflash串口烧写CC3200的常见问题

    1. 在正常情况下,cc3200的烧写使用的是芯片的PIN55和PIN57,只要把SOP2上拉既可正常烧写,常见问题是烧写的时候没有上拉SOP2,正常运行SOP2留空,IAR只能仿真调试,不能下载程序 ...

  7. mysql 导入CSV数据 [转]

    转自: http://blog.chinaunix.net/uid-23284114-id-3196638.html MYSQL   LOAD DATA INFILE命令可以把csv平面文件中的数据导 ...

  8. 虚拟现实-VR-UE4-构建光照显示光照构建失败,Swarm启动失败

    闲的无聊折腾,发现想构建光照的时候,总是显示失败 如下图 百度许久,有大神指出是我在编译源码的的时候没有将其中的某个模块编译进去,只需要重新编译摸个模块就好 在UE4 的sln文件下,会看到一个Unr ...

  9. python基础训练营03——字典、集合、判断、循环

    一.字典dict: 相比列表list而言,列表list像一本书,如果要查书中的某一个内容,需要把书从前往后翻一遍,直到找到想要获取的东西:而字典dict,就像现实中的字典一样,通过查找特定的字或者词( ...

  10. spring mvc:实现给Controller函数传入list<pojo>参数

    [1]前端js调用示例: ...insertStatisData?statisDatas=[{'cid':'2','devId':'9003','deviceName':'测试名','endTime' ...