在线不卡日本ⅴ一区v二区_精品一区二区中文字幕_天堂v在线视频_亚洲五月天婷婷中文网站

  • <menu id="lky3g"></menu>
  • <style id="lky3g"></style>
    <pre id="lky3g"><tt id="lky3g"></tt></pre>

    Git命令簡單使用

    Git命令簡單使用

    背景

    最近經(jīng)常使用Github,每次修改個文件代碼都要在網(wǎng)頁端操作,感覺效率低下,所以簡答學習了解了一下Git命令。至使于可以在命令行進行管理Git倉庫,這樣就不需要每次都要打開網(wǎng)頁版Github進行操作。

    常用命令使用

    # 拉取服務器代碼,更新本地代碼,避免覆蓋他人代碼root@hello:~/Kubernetes# git pull Already up to date.root@hello:~/Kubernetes# # 修改文件root@hello:~/Kubernetes# vim README.md# 將狀態(tài)改變的代碼提交至緩存root@hello:~/Kubernetes# git add .# 查看當前項目中有哪些文件被修改過root@hello:~/Kubernetes# git statusOn branch mainYour branch is up to date with ‘origin/main’.Changes to be committed: (use “git restore –staged …” to unstage) modified: README.mdroot@hello:~/Kubernetes# # 將代碼提交到本地倉庫中root@hello:~/Kubernetes# git commit -m update[main 260d794] update 1 file changed, 25 insertions(+), 25 deletions(-)root@hello:~/Kubernetes# # 將緩存區(qū)代碼推送到遠程倉庫root@hello:~/Kubernetes# git pushUsername for ‘https://github.com’: cby-chenPassword for ‘https://[email protected]’: Enumerating objects: 5, done.Counting objects: 100% (5/5), done.Delta compression using up to 8 threadsCompressing objects: 100% (3/3), done.Writing objects: 100% (3/3), 434 bytes | 434.00 KiB/s, done.Total 3 (delta 2), reused 0 (delta 0), pack-reused 0remote: Resolving deltas: 100% (2/2), completed with 2 local objects.To https://github.com/cby-chen/Kubernetes.git a101d22..260d794 main -> mainroot@hello:~/Kubernetes#

    注意

  • 在push的時候是需要輸入token,這個token需要在:https://github.com/settings/tokens 進行創(chuàng)建
  • GitHub的README.md文件內容換行,直接在要換行的語句最后打上2個空格。
  • 如果你覺得 git add 提交緩存的流程太過繁瑣,Git 也允許你用 -a 選項跳過這一步。命令格式如下:`git commit -a`
  • 關于

    https://www.oiox.cn/

    https://www.oiox.cn/index.php/start-page.html

    CSDN、GitHub、知乎、微信公眾號、開源中國、思否、掘金、簡書、華為云、阿里云、騰訊云、嗶哩嗶哩、今日頭條、新浪微博、個人博客

    全網(wǎng)可搜《小陳運維》

    文章主要發(fā)布于微信公眾號

    鄭重聲明:本文內容及圖片均整理自互聯(lián)網(wǎng),不代表本站立場,版權歸原作者所有,如有侵權請聯(lián)系管理員(admin#wlmqw.com)刪除。
    上一篇 2022年6月16日 12:04
    下一篇 2022年6月16日 12:04

    相關推薦

    聯(lián)系我們

    聯(lián)系郵箱:admin#wlmqw.com
    工作時間:周一至周五,10:30-18:30,節(jié)假日休息