首页 > 其他分享 >oschina/git github使用指南

oschina/git github使用指南

时间:2022-12-12 15:34:26浏览次数:75  
标签:src git java oschina medsoft 使用指南 main com

我的github仓库开通,https://git.oschina.net/zhjh256。

1、打开https://git.oschina.net/signup,没有账号的话,则新创建账号。

2、从https://github.com/git-for-windows/git/releases/download/v2.9.2.windows.1/Git-2.9.2-64-bit.exe下载并安装。

3、登录git.oschina.net,新建一个项目。

4、打开git bash,如下:

oschina/git github使用指南_java

5、生成ssh公钥,如下所示:

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/zjhua/.ssh/id_rsa):
Created directory '/c/Users/zjhua/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/zjhua/.ssh/id_rsa.
Your public key has been saved in /c/Users/zjhua/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:mOt2ztatHjrGTi8jGaekWo6EXtwy5jOl+12zqZFsVcs zjhua@WINDOWS-DV8B1PN
The key's randomart image is:
+---[RSA 2048]----+
| |
| |
| . |
| o o . |
| o S. E |
| .. ..+.+ |
|. .*++.@.+.. |
|..+B+.Bo@o=.. |
| .o+*o.X*B+. |
+----[SHA256]-----+

6、打开https://git.oschina.net/profile/sshkeys,将id_rsa.pub中的内容拷贝到相应位置,如下:

oschina/git github使用指南_git_02

 

7、回到git bash,执行下列命令:

$ ssh -T [email protected]
The authenticity of host 'git.oschina.net (120.55.239.11)' 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.239.11' (ECDSA) to the list of known hosts.
Welcome to Git@OSC, HS专用!

 出现红色代表配置成功。

或$ ssh -T [email protected]

8、创建git项目的本地副本。

$ git clone https://git.oschina.net/zhjh256/testgit.git

或 git clone [email protected]:hslightdb/auto_explain.git
Cloning into 'testgit'...
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 5 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
Checking connectivity... done.

 -------------增加项目或者修改内容---------------

9、提交本地修改

zjhua@WINDOWS-DV8B1PN MINGW64 /d/test/testgit (master)
$ git add *

zjhua@WINDOWS-DV8B1PN MINGW64 /d/test/testgit (master)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

new file: pom.xml
new file: src/main/java/com/medsoft/base/utils/JsonUtils.java
new file: src/main/java/com/medsoft/dlcache/AbstractLocalCacheInitializer.java
new file: src/main/java/com/medsoft/dlcache/CacheEntry.java
new file: src/main/java/com/medsoft/dlcache/LocalCacheContainer.java
new file: src/main/java/com/medsoft/dlcache/LocalCacheService.java
new file: src/main/java/com/medsoft/dlcache/LocalCacheServiceImpl.java
new file: src/main/java/com/medsoft/dlcache/LocalCacheUpdateListener.java
new file: src/main/java/com/medsoft/dlcache/mq/LocalCacheQueueListener.java
new file: src/main/java/com/medsoft/dlcache/mq/MQProducer.java
new file: src/main/java/com/medsoft/dlcache/mq/MQProducerImpl.java

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

.classpath
.project

zjhua@WINDOWS-DV8B1PN MINGW64 /d/test/testgit (master)
$ git commit -m "initial commit"
[master 01f1e90] initial commit
11 files changed, 998 insertions(+)
create mode 100644 pom.xml
create mode 100644 src/main/java/com/medsoft/base/utils/JsonUtils.java
create mode 100644 src/main/java/com/medsoft/dlcache/AbstractLocalCacheInitializer.java
create mode 100644 src/main/java/com/medsoft/dlcache/CacheEntry.java
create mode 100644 src/main/java/com/medsoft/dlcache/LocalCacheContainer.java
create mode 100644 src/main/java/com/medsoft/dlcache/LocalCacheService.java
create mode 100644 src/main/java/com/medsoft/dlcache/LocalCacheServiceImpl.java
create mode 100644 src/main/java/com/medsoft/dlcache/LocalCacheUpdateListener.java
create mode 100644 src/main/java/com/medsoft/dlcache/mq/LocalCacheQueueListener.java
create mode 100644 src/main/java/com/medsoft/dlcache/mq/MQProducer.java
create mode 100644 src/main/java/com/medsoft/dlcache/mq/MQProducerImpl.java

zjhua@WINDOWS-DV8B1PN MINGW64 /d/test/testgit (master)
$ git push sl HEAD
fatal: 'sl' does not appear to be a git repository
fatal: Could not read from remote repository.

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

zjhua@WINDOWS-DV8B1PN MINGW64 /d/test/testgit (master)
$ git push
Username for 'https://git.oschina.net': zhjh256
Counting objects: 22, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (22/22), 11.52 KiB | 0 bytes/s, done.
Total 22 (delta 2), reused 0 (delta 0)
To https://git.oschina.net/zhjh256/testgit.git
04042d9..01f1e90 master -> master

$ git push
Username for 'https://github.com': zjhua
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/hslightdb/citus-benchmarksql.git/'

参考 ​​javascript:void(0)​​,获取personel key解决。

$ git push https://[email protected]/hslightdb/citus-benchmarksql.git
remote: Permission to hslightdb/citus-benchmarksql.git denied to hslightdb.
fatal: unable to access 'https://[email protected]/hslightdb/citus-benchmarksql.git/': The requested URL returned error: 403

10、打开https://git.oschina.net/zhjh256/testgit,看是不是已经提交了。。。

oschina/git github使用指南_java_03

 

git默认不上传空的文件夹,如果处于项目结构完整性的考虑需要保留目录结构的话,需要在空文件夹中创建一个占位文件比如.gitkeep。

其他:

1、The file will have its original line endings in your working directory。

不影响提交,忽略即可。

2、fatal: empty ident name (for <[email protected]>) not allowed

解决方法:设置user.email和user.name即可

admin@DESKTOP-LUSBR0A MINGW64 /D/ldpp/trunk/code/io-spider (master)
$ git config --global user.name "zhjh256"

admin@DESKTOP-LUSBR0A MINGW64 /D/ldpp/trunk/code/io-spider (master)
$ git config --global user.email "[email protected]"

admin@DESKTOP-LUSBR0A MINGW64 /D/ldpp/trunk/code/io-spider (master)
$ git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=D:/ProgramFiles/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
user.name=e
[email protected]
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=https://git.oschina.net/zhjh256/io-spider.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

3、删除项目

oschina/git github使用指南_git_04

oschina/git github使用指南_git_05

 

关于git暂存区

fatal: unable to checkout working tree

$ git clone https://gitlab.hundsun.com/LightDB1.0/lightdb-installer.git
Cloning into 'lightdb-installer'...
remote: Enumerating objects: 8873, done.
remote: Counting objects: 100% (8873/8873), done.
remote: Compressing objects: 100% (2197/2197), done.
remote: Total 8873 (delta 5475), reused 8728 (delta 5372)
Receiving objects: 100% (8873/8873), 2.14 GiB | 1.68 MiB/s, done.
Resolving deltas: 100% (5475/5475), done.
error: unable to write file bellsoft-jdk11.0.12+7-linux-aarch64-full.tar.gz
error: unable to write file bellsoft-jdk11.0.12+7-linux-amd64-full.tar.gz
error: unable to write file loongson11.1.0-jdk-11.0.13-fx-internal-loongarch64.tar.gz
error: unable to write file loongson11.1.0-jdk11.0.13_8-linux-loongarch64.tar.gz
Checking out files: 100% (413/413), done.
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

检查是否没有内存、空间了?参考​​https://www.e-learn.cn/content/qita/660565​​。果然,空间不够了,如下:

zjhua@WINDOWS-MUOVTG8 MINGW64 /e/LightDB-EM-git
$ df -h
Filesystem Size Used Avail Use% Mounted on
D:/Program Files/Git 121G 118G 3.0G 98% /
C: 100G 92G 7.6G 93% /c
E: 121G 121G 7.5M 100% /e
F: 137G 135G 2.0G 99% /f

释放空间后,重新git clone即可。


标签:src,git,java,oschina,medsoft,使用指南,main,com
From: https://blog.51cto.com/zhjh256/5929833

相关文章

  • git流程
    前言今天又被人问git的相关处理问题,干脆整理在一块记录起来,简单明了也方便新人学习使用//平时拉代码gitclone项目地址;//平时提交代码gitpullgitadd要......
  • digital envelope routines::unsupported
    windows装了高版本的nodejs,运行或构建VUE项目时可能会出现error:0308010C:digitalenveloperoutines::unsupported的错误。解决方法是:在运行或构建项目之前设置setNOD......
  • Github标星2.3k+!这个仓库提供了靠谱的入门人工智能的路线及资料!
    本文为AI入门者推荐一个Github仓库,仓库推荐了一个简易的学习路线,并提供了代码和数据集下载。本文作者:黄海广一、前言AI以及机器学习入门,初学者遇到的问题非常多,但最大的问......
  • 项目启动报错: Vue 报错error:0308010C:digital envelope routines::unsupported
      Vue报错error:0308010C:digitalenveloperoutines::unsupported查了好多,找出原因:因为我刚装了最新的node版本18.12.1出现这个错误是因为 node.jsV17版本中最......
  • [记]git的简单使用
    gitinit创建新的git仓库gitcloneusername@host:/path/to/repository克隆远端服务器上的仓库gitadd*添加所有更改gitcommit-m"代码提交信息"暂存改动gitpu......
  • Jgit的使用笔记
    原文:Jgit的使用笔记-Stars-One的杂货小窝之前整的一个系统,涉及到git代码的推送,是通过cmd命令去推送的,然后最近在产品验收的时候,测试部门随意填了个git仓库,然后导致仓......
  • 《统计学习方法》代码更新了-(github的star数5300+)
    李航老师的《统计学习方法》可以说是机器学习的入门宝典,许多机器学习培训班、互联网企业的面试、笔试题目,很多都参考这本书。2019年5月1日,《统计学习方法第二版》出版了!本人......
  • 分享:我是怎么在github上找到优秀的仓库的?
    大家可以注意到,我经常向大家推荐优秀的github仓库,可能大家有疑问:怎么样找到优秀的github仓库呢?本文分享下我是怎么在github上找到优秀的仓库的?通常情况下,在github上查找优秀......
  • 黄海广博士的github镜像下载(机器学习及深度学习资源)
    黄海广博士在github开源了吴恩达老师的机器学习及深度学习个人笔记,成为热门项目,详情报道见​​文章​​。其中机器学习笔记5600star,深度学习笔记3800star。由于某种原因,国内......
  • 推荐:常见算法的python实现(github上25000多star)
    近日在github上发现一个25000多star的仓库,把各种常见算法用python实现了,而且还有动图演示,非常值得推荐。仓库说明这个仓库用python语言实现了绝大部分算法,主要是用于教学目......