配置用户名:$ git config --glob user.name "forever"
配置邮箱:$ git config --glob user.email "*******@163.com"
不管换行:$ git config --glob core.autocrlf false
 
编码:$ git config --glob gui.encoding  utf-8
避免git status乱码:$ git config --glob core.quotepath off
 
windows:
$ git config --glob core.ignorecase  false
 
$ ssh-keygen -t rsa -C "****@163.com"
$ eval `ssh-agent`
$ ssh-add ~/.ssh/id_rsa
 
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDL9BRs1EJbHaOi32W042X/hVY/DAJ2amBHvlm8zkYRcl7CS7f6Cwv+f/42Zw9oF/kjq1Rm9Mzjua8EMRVU/L7W1jeO158cs7shtCx97vcPu1q50zMCaj57J6XVZZCWvLWb484YUkY5PhgXLscc1Br5CfdDTAvNjfKQcKGo3cOSLPDqXoIb0MY1uvfyEluFQYZ/f+noY21Izug3cfn/zYGAM0FX5JHqkN6sitxMRHLVLsvbFehWDxnF*AubzxGSpP9sBX3KwwV1CQibt4Ej4XxJXCq5zNSWKaNj88LcSfAZ+2culfya7HFXeKcBItrbICJBT3BHa8z/TKanIQbJFbiV *****@163.com
 
登陆 https://gitee.com/  去
设置中添加
公钥
 
完成
然后添加项目
 
添加完成如下图:
添加记住远程git仓库地址:git@gitee.com:forever2015_LLH/test_learning.git
 
 
 
本地操作,idea 
1.添加忽略配置文件
 
配置文件内容
*.class
#package file
*.war
*.ear
 
*.orig
 
target/
 
#eclipse ignore
.settings/
.progect
.classpath
 
#idea
.idea/
/idea/
*.ipr
*.iml
*.iws
 
#tem file
*.log
*.cache
*.diifgit
*.patch
*.tmp
 
 
#system ignore
.DS_Store
Thumbs.db
 
 
 
首先执行  git init ->在执行git status 查看要上传的文件 -> 添加 git add . ->在查看看到文件变化->在执行git commit(-am  '注释') 提交到本地仓库->提交到远程仓库地址 git remote add origin git@gitee.com:forever2015_LLH_liuluheng2015/test1.git
 
查看当前分支:git branch
推送到远程git仓库: git push -u origin master
 
会出先错误:
E:\Java\2015WorkSpace>git push -u origin master
! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@gitee.com:forever2015_LLH/test_learning.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
 
拉取:
E:\Java\2015WorkSpace>git pull
warning: no common commits
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
* [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
 
落后于当前:再次失败
E:\Java\2015WorkSpace>git push -u origin master
! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@gitee.com:forever2015_LLH/test_learning.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
 
(由于第一次所以强制推送)
E:\Java\2015WorkSpace>git push -u -f origin master
Counting objects: 18, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (18/18), 5.35 KiB | 0 bytes/s, done.
Total 18 (delta 0), reused 0 (delta 0)
remote: Powered by Gitee.com
+ a8d8c85...cdda889 master -> master (forced update)
Branch master set up to track remote branch master from origin.
 
查看远程分:git branch -r  然后根据主干创建本地分支
 
 
把本地分支推送到主干
 
git  push origin head -u
 
 
 
 
 
 
 
 
 

git在idea中的使用,如何构远程git方仓库的更多相关文章

  1. git上传中的排除的配置文件, git实际的操作代码;

    git上传中的排除的配置文件: git实际的操作 在主目录建立.gitignore文件并输入以下保存: *.class #package file *.war *.ear #kdiff3 ignore ...

  2. 【Git】工作中99%能用到的git命令

    Git使用笔记 1.第一次使用github ============================================= 1)github注册账号 使用邮箱注册账号 先不要创建版本库 2 ...

  3. Git 在团队中的使用--如何正确使用Git Flow

    Git的优点 Git的优点很多,但是这里只列出我认为非常突出的几点. 由于是分布式,所有本地库包含了远程库的所有内容. 优秀的分支模型,打分支以及合并分支,机器方便. 快速,在这个时间就是金钱的时代, ...

  4. git status 显示中文和解决中文乱码

    目录 git status 显示中文和解决中文乱码 解决git status不能显示中文 解决git bash 终端显示中文乱码 通过修改配置文件来解决中文乱码 git status 显示中文和解决中 ...

  5. 为Spring Cloud Config Server配置远程git仓库

    简介 虽然在开发过程,在本地创建git仓库操作起来非常方便,但是在实际项目应用中,多个项目组需要通过一个中心服务器来共享配置,所以Spring Cloud配置中心支持远程git仓库,以使分散的项目组更 ...

  6. git向远程git仓库提交代码步骤详解

    一.从远程仓库clone工程到本地 git clone -b 分支名称 http://10.1.1.11/service/tmall-service.git  localDestDirectory l ...

  7. git 初始化本地项目并推送到远程

    有一个新项目,开发了一些代码之后想推送到远程,具体的操作方式和命令如下: (使用 git bash) 1.切到项目目录中,例如 E:\git\smart-open 2.初始化git仓库并在本地提交 / ...

  8. Git 在团队中的最佳实践--如何正确使用Git Flow

    我们已经从SVN 切换到Git很多年了,现在几乎所有的项目都在使用Github管理, 本篇文章讲一下为什么使用Git, 以及如何在团队中正确使用. Git的优点 Git的优点很多,但是这里只列出我认为 ...

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

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

随机推荐

  1. shell编程学习笔记之特殊变量($0、$1、$2、 $?、 $# 、$@、 $*)

    特殊变量($0.$1.$2. $?. $# .$@. $*) shell编程中有一些特殊的变量可以使用.这些变量在脚本中可以作为全局变量来使用. 名称 说明 $0 脚本名称 $1-9 脚本执行时的参数 ...

  2. winform中splitter的用法

    1.将winform分为三列 整个窗体分成可以自动调节的三列的做法:1.往窗体上丢两个panel控件其中:panelLeft——设置Dock属性为“left”,并调节好其宽度panelRight——设 ...

  3. 断开网络连接的dos命令

    https://zhidao.baidu.com/question/154994771.html 或者采用服务关闭开启模式,不过没有上面的好用net stop "network connec ...

  4. 复习_for循环嵌套 及 流程图梳理

    原题: 使用for循环输出如下图形: * ** *** **** 分析及做法. 图链接: https://www.processon.com/view/link/5afba745e4b05352c2b ...

  5. ActiveMQ 负载均衡与高可用(转载)

    一.架构和技术介绍 1.简介 ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线.完全支持JMS1.1和J2EE 1.4规范的 JMS Provider实现 2.activemq的 ...

  6. FOJ-1001-Duplicate Pair

    题目:Duplicate Pair 大意: 有多组测试数据,输入整数n,接着输入n个整数(integers),这些数字几乎都只出现一次,但其中有一个数出现了两次,请输出这个数. 题解: 大数据问题,普 ...

  7. POJ 2117 Electricity(割点求连通分量)

    http://poj.org/problem?id=2117 题意:求删除图中任意一个顶点后的最大连通分量数. 思路: 求出每个割点对应的连通分量数,注意这道题目中图可能是不连通的. 这道题目我wa了 ...

  8. MongoDB(课时4 数据增加)

    3.4 数据操作(重点) 只要是数据库就绝对离不开最核心的功能:CRUD(增加Create.读取查询Retrieve.更新Update.删除Delete),除了增加之外,其他都很麻烦,最麻烦的是修改. ...

  9. C++创建虚拟机调用JAVA类

    ZC: 简要摘抄: “ 1.      Object类出创建JVM. 使用Java类之前必须要创建JVM环境.JDK由java.exe来完成.本文有Object类的静态方法BeginJVM来创建,用E ...

  10. 《F4+2》β冲刺第二天

    β冲刺第二天 1.每个成员今日完成的任务: 马仲山:系统代码和开发总结文档的完善 马婧(12):完善需求文档 马婧(13):完善设计文档 马世芳:对部分功能实现进行测试 张俊逸:针对测试出现的问题完善 ...