使用git命令提交代码到Github远程仓库的方法
生活随笔
收集整理的這篇文章主要介紹了
使用git命令提交代码到Github远程仓库的方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
首先新建一個github地址倉庫名字隨便取:
文件然后記下github倉庫的地址,在桌面新建剛剛創建創庫的名字為文件夾,添加一些項目文件后使用這個命令初始化倉庫:git init
如下圖:
2.使用這個命令添加所有文件到本地倉庫:git add .
3.使用git命令:git remote add origin https://github.com/xiayiye5/XiaYiYe5Tools,將本地倉庫與遠程倉庫建立關聯
4.使用git命令:git commit -m "文件注釋", 將本地數據提交到本地倉庫中
5.使用git命令:git push -u origin master,將本地倉庫數據提交到已關聯的遠程倉庫中,輸入你github的賬號密碼即可
6.第一次彈框輸入賬號密碼可能會失敗,不要管再次提交會彈出下面github的登錄頁面輸入賬號密碼即可提交成功
7.看到上面顯示提交成功了,我們上github上面看看吧:
就此完工!!
看下完整的git命令提交圖:
完整版命令提交圖2:
感謝博主:博主直達
Command line instructions You can also upload existing files from your computer using the instructions below.Git global setup git config --global user.name "Cong Zheng" git config --global user.email "cong.zheng@wyze.cn"Create a new repository git clone git@ocean.wyzecam.com:jiuan/3irobotics/wyzecomet.git cd wyzecomet touch README.md git add README.md git commit -m "add README"Push an existing folder cd existing_folder git init git remote add origin git@ocean.wyzecam.com:jiuan/3irobotics/wyzecomet.git git add . git commit -m "Initial commit"Push an existing Git repository cd existing_repo git remote rename origin old-origin git remote add origin git@ocean.wyzecam.com:jiuan/3irobotics/wyzecomet.git?
?
總結
以上是生活随笔為你收集整理的使用git命令提交代码到Github远程仓库的方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android开发之打开QQ聊天页面的方
- 下一篇: 安全风险大,马斯克脑机接口人体试验申请被