前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >git初始化

git初始化

作者头像
sanmutongzi
发布2020-03-04 14:31:13
7810
发布2020-03-04 14:31:13
举报
文章被收录于专栏:stream processstream process

一 设置用户名密码

1 git config --global user.name "laolang205"

2 git config --global user.email "dxyang@kaikeba.com"

二 本地版本库提交项目

1 cd /path/to/myworkspace

2 git init

3 git add src

4 git add pom.xml

5 git add assembly.xml

6 git commit -m "commit message"

三 远程同步到github

6:pull远程到本地 $ git pull https://github.com/guojiangshan/canyin master warning: no common commits remote: Counting objects: 5, done. remote: Compressing objects: 100% (4/4), done. remote: Total 5 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (5/5), done. From https://github.com/guojiangshan/canyin * branch master -> FETCH_HEAD Merge made by the 'recursive' strategy. .gitignore | 11 ++ LICENSE | 339 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 4 + 3 files changed, 354 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md

7:设置 git ignore 过滤文件,.class 后缀文件不提交到远程 $ echo *.class>.gitignore 查看设置是否成功: $ cat .gitignore *.class

8:再次push,成功 $ git push https://github.com/guojiangshan/canyin master Username for 'https://github.com': guojiangshan Password for 'https://guojiangshan@github.com': Counting objects: 116, done. Delta compression using up to 4 threads. Compressing objects: 100% (102/102), done. Writing objects: 100% (115/115), 58.02 KiB | 0 bytes/s, done. Total 115 (delta 6), reused 0 (delta 0) To https://github.com/guojiangshan/canyin f7ddeea..5fd03b6 master -> master

代码语言:javascript
复制
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/laolang205/lalala.git
git push -u origin master
代码语言:javascript
复制

…or push an existing repository from the command line

代码语言:javascript
复制
git remote add origin https://github.com/laolang205/lalala.git
git push -u origin master
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2014-12-17 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一 设置用户名密码
  • 二 本地版本库提交项目
  • 三 远程同步到github
    • …or push an existing repository from the command line
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档