【Git】IntelliJ IDEA 提交代码到 GitCode 远程仓库 ( GitCode 创建远程仓库 | 将本地工程推送到 GitCode 远程仓库 | 验证权限 | 生成个人访问令牌 )
文章目錄
- 前言
- 一、GitCode 創(chuàng)建遠(yuǎn)程倉(cāng)庫(kù)
- 二、將本地工程推送到 GitCode 遠(yuǎn)程倉(cāng)庫(kù)
- 三、驗(yàn)證權(quán)限
前言
GitHub 又掛了 , 國(guó)內(nèi)不太好用 , 現(xiàn)在開(kāi)始使用 gitcode , 地址為 https://gitcode.net ;
一、GitCode 創(chuàng)建遠(yuǎn)程倉(cāng)庫(kù)
點(diǎn)擊右側(cè)頭像左邊的 + 按鈕 , 在彈出的列表中 , 選擇 " 新建項(xiàng)目 " 按鈕 ;
選擇創(chuàng)建空白項(xiàng)目 ;
在下面只需要輸入項(xiàng)目名稱(chēng)即可 ;
二、將本地工程推送到 GitCode 遠(yuǎn)程倉(cāng)庫(kù)
這里按照推送現(xiàn)有文件夾的方案 , 推送文件夾 ;
cd existing_folder git init git remote add origin https://gitcode.net/han12020121/groovy_demo.git git add . git commit -m "Initial commit" git push -u origin master完整的執(zhí)行流程 :
Microsoft Windows [版本 10.0.19043.1348] (c) Microsoft Corporation。保留所有權(quán)利。Y:\002_WorkSpace\003_IDEA\Groovy_Demo>git init Initialized empty Git repository in Y:/002_WorkSpace/003_IDEA/Groovy_Demo/.git/Y:\002_WorkSpace\003_IDEA\Groovy_Demo>git remote add origin https://gitcode.net/han12020121/groovy_demo.gitY:\002_WorkSpace\003_IDEA\Groovy_Demo>git add . warning: LF will be replaced by CRLF in gradle/wrapper/gradle-wrapper.properties. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in gradlew. The file will have its original line endings in your working directoryY:\002_WorkSpace\003_IDEA\Groovy_Demo> Y:\002_WorkSpace\003_IDEA\Groovy_Demo>git commit -m "Initial commit" [master (root-commit) 0d26998] Initial commit21 files changed, 335 insertions(+)create mode 100644 .gradle/5.2.1/executionHistory/executionHistory.bincreate mode 100644 .gradle/5.2.1/executionHistory/executionHistory.lockcreate mode 100644 .gradle/5.2.1/fileChanges/last-build.bincreate mode 100644 .gradle/5.2.1/fileHashes/fileHashes.bincreate mode 100644 .gradle/5.2.1/fileHashes/fileHashes.lockcreate mode 100644 .gradle/5.2.1/gc.propertiescreate mode 100644 .gradle/buildOutputCleanup/buildOutputCleanup.lockcreate mode 100644 .gradle/buildOutputCleanup/cache.propertiescreate mode 100644 .gradle/buildOutputCleanup/outputFiles.bincreate mode 100644 .gradle/vcs-1/gc.propertiescreate mode 100644 .idea/.gitignorecreate mode 100644 .idea/gradle.xmlcreate mode 100644 .idea/jarRepositories.xmlcreate mode 100644 .idea/misc.xmlcreate mode 100644 .idea/vcs.xmlcreate mode 100644 build.gradlecreate mode 100644 gradle/wrapper/gradle-wrapper.jarcreate mode 100644 gradle/wrapper/gradle-wrapper.propertiescreate mode 100644 gradlewcreate mode 100644 gradlew.batcreate mode 100644 settings.gradleY:\002_WorkSpace\003_IDEA\Groovy_Demo> Y:\002_WorkSpace\003_IDEA\Groovy_Demo>git push -u origin master info: detecting host provider for 'https://gitcode.net/'... warning: ----------------- SECURITY WARNING ---------------- warning: | TLS certificate verification has been disabled! | warning: --------------------------------------------------- warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information. warning: ----------------- SECURITY WARNING ---------------- warning: | TLS certificate verification has been disabled! | warning: --------------------------------------------------- warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information. info: detecting host provider for 'https://gitcode.net/'... warning: ----------------- SECURITY WARNING ---------------- warning: | TLS certificate verification has been disabled! | warning: --------------------------------------------------- warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information. Enumerating objects: 32, done. Counting objects: 100% (32/32), done. Delta compression using up to 12 threads Compressing objects: 100% (22/22), done. Writing objects: 100% (32/32), 55.33 KiB | 3.25 MiB/s, done. Total 32 (delta 2), reused 0 (delta 0), pack-reused 0 remote: remote: ======================================================================== remote: remote: [codechina.csdn.net 域名 remote: 12月22日停用公告](https://gitcode.net/gitcode/help-docs/-/issues/1) remote: remote: ======================================================================== remote: To https://gitcode.net/han12020121/groovy_demo.git* [new branch] master -> master Branch 'master' set up to track remote branch 'master' from 'origin'.Y:\002_WorkSpace\003_IDEA\Groovy_Demo>提交的代碼如下 :
三、驗(yàn)證權(quán)限
其中有個(gè)步驟需要輸入賬號(hào)密碼 , 這里的賬號(hào)是 CSDN 用戶(hù)賬號(hào) , 密碼是 個(gè)人訪(fǎng)問(wèn)令牌 , 參考 【Git】Git 分支管理 ( 解決分支合并沖突 | 推送主版本和分支版本到遠(yuǎn)程倉(cāng)庫(kù) | 合并分支出現(xiàn)文件沖突 ) 一、推送主版本和分支版本到遠(yuǎn)程倉(cāng)庫(kù) 博客章節(jié) ;
點(diǎn)擊右側(cè)頭像 , 然后選擇 " 設(shè)置 " , 在設(shè)置界面的 " 訪(fǎng)問(wèn)令牌 " 可以生成 " 個(gè)人訪(fǎng)問(wèn)令牌 " , 此處生成的 個(gè)人訪(fǎng)問(wèn)令牌 可以作為上面的 GitCode 提交代碼時(shí)的密碼使用 ;
總結(jié)
以上是生活随笔為你收集整理的【Git】IntelliJ IDEA 提交代码到 GitCode 远程仓库 ( GitCode 创建远程仓库 | 将本地工程推送到 GitCode 远程仓库 | 验证权限 | 生成个人访问令牌 )的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 【Groovy】Groovy 代码创建
- 下一篇: 【Groovy】字符串 ( 字符串类型变