【Git】IntelliJ IDEA 提交代码到 GitCode 远程仓库 ( GitCode 创建远程仓库 | 将本地工程推送到 GitCode 远程仓库 | 验证权限 | 生成个人访问令牌 )
生活随笔
收集整理的這篇文章主要介紹了
【Git】IntelliJ IDEA 提交代码到 GitCode 远程仓库 ( GitCode 创建远程仓库 | 将本地工程推送到 GitCode 远程仓库 | 验证权限 | 生成个人访问令牌 )
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
文章目錄
- 前言
- 一、GitCode 創(chuàng)建遠程倉庫
- 二、將本地工程推送到 GitCode 遠程倉庫
- 三、驗證權限
前言
GitHub 又掛了 , 國內不太好用 , 現(xiàn)在開始使用 gitcode , 地址為 https://gitcode.net ;
一、GitCode 創(chuàng)建遠程倉庫
點擊右側頭像左邊的 + 按鈕 , 在彈出的列表中 , 選擇 " 新建項目 " 按鈕 ;
選擇創(chuàng)建空白項目 ;
在下面只需要輸入項目名稱即可 ;
二、將本地工程推送到 GitCode 遠程倉庫
這里按照推送現(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。保留所有權利。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>提交的代碼如下 :
三、驗證權限
其中有個步驟需要輸入賬號密碼 , 這里的賬號是 CSDN 用戶賬號 , 密碼是 個人訪問令牌 , 參考 【Git】Git 分支管理 ( 解決分支合并沖突 | 推送主版本和分支版本到遠程倉庫 | 合并分支出現(xiàn)文件沖突 ) 一、推送主版本和分支版本到遠程倉庫 博客章節(jié) ;
點擊右側頭像 , 然后選擇 " 設置 " , 在設置界面的 " 訪問令牌 " 可以生成 " 個人訪問令牌 " , 此處生成的 個人訪問令牌 可以作為上面的 GitCode 提交代碼時的密碼使用 ;
總結
以上是生活随笔為你收集整理的【Git】IntelliJ IDEA 提交代码到 GitCode 远程仓库 ( GitCode 创建远程仓库 | 将本地工程推送到 GitCode 远程仓库 | 验证权限 | 生成个人访问令牌 )的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Groovy】Groovy 代码创建
- 下一篇: 【Android 逆向】Dalvik 函