Git Brash 的使用總結(持續更新)


  1. git Brash
  • git 是 分布式控制系統,能夠在本地上管理代碼,或者上傳代碼。
  • git brash 是 windows 下的 git 命令工具。
  1. 使用

    • 打開git Brash
    • 查看是是否安裝了git
      • git -version
    • 設置 本地倉庫
      • 右鍵選中要做為本地倉庫的文件夾
      • 選擇Git Brash Here
      • 輸入 git init ,當前文件夾會出現一個.git文件夾
      • ls -al 查看當前的文件夾
    • 從github上克隆文件到本地
      • git clone **
      • ** 代表是你所在的github上的.git后綴名的地址。在github上可以查看到。
    • 上傳文件
      • git add . 將改動添加到暫存區
      • git commit -m "first commit"
    • 修改文件
    • 提交到github上
      • git remote add origin github上已存在的項目地址 //origin是別名
    • 將本地更改推送到遠程的master
      • git push origin master
      • 如果github的remote上已經有了文件,會出現錯誤。先進行pull操作,再push
        • git pull origin master
        • git push origin master
    • 查看git-config
      • git config --list
    • 設置全局變量
      • git config --global user.name "123"
      • git config --global user.email "123@163.com"
    • 分支
      • 新建分支並跳轉到分支
        • git checkout -b gh-pages
      • 查看本地所有分支
        • git branch
      • 查看本地和遠程上的所有分支
        • git branch -a
      • 刪除本地分支
        • git branch -d gh-pgaes
      • 刪除遠程分支
        • git push origin --delete gh-pages
      • 強制新增文件夾dist
        • git add -f dist
      • 將倉庫中某一個文件夾作為展示項(gh-pages)
        • git subtree push --prefix=dist origin gh-pages
      • 將某倉庫中所有都展示
        + text git:(master) git symbolic-ref HEAD refs/heads/gh-pages
        + git add -A
        + git commit -m "..."
        + git push origin gh-pages

    參考:
    https://www.jianshu.com/p/6da1027239c6


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM