麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 網管 > 服務器 > 正文

git命令添加 修改 刪除 沖突解決辦法

2020-05-27 13:03:47
字體:
來源:轉載
供稿:網友

   如果對git命令行不熟悉的話,用git圖形界面工具,就比較合適了。建議使用tortoisegit這樣的工具,命令行從學習到靈活掌握的時間成本比較高的。

  1,添加

  # git clone [email protected]:develop/test.git

  # cd test

  # touch test.txt //測試文件

  # git add test.txt //git添加文件

  # git commit -m test //添加到本地版本庫

  # git push //push到遠程

  如果push報錯,Perhaps you should specify a branch such as master

  解決辦法:

  # git push origin master //只要這樣操作一次,以后就可以用git push

  添加文件和添加目錄,操作是一樣的。

  2,修改文件

  方法一

  # echo "11111111111" > test.txt

  # git add test.txt && git commit -m test2

  # git push

  方法二

  # echo "abc" > test.txt

  # git commit -am "test3" //所有修改都會提交

  # git push

  如果有多個文件,只想提交其中的一個或者多個,怎么辦呢

  # git commit -a //該命令出現以下內容

  # Please enter the commit message for your changes. Lines starting

  # with # will be ignored, and an emptyempty message aborts the commit.

  # On branch master

  # Changes to be committed:

  # (use "git reset HEAD ..." to unstage)

  #

  # modified: ab

  # modified: test.txt //如果只想提交test.txt,只要把該行前的#去掉,保存退出就行了

  # git push //退出后,在執行push

  3,刪除

  # git rm ab //如果刪除目錄的話,加上-r

  # git commit -am "del"

  # git push

  4,解決沖突

  # git push //push不上去

  Address 192.168.10.202 maps to unassigned.psychz.net, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!

  To [email protected]:develop/test.git

  ! [rejected] master -> master (non-fast-forward)

  error: failed to push some refs to 192.168.10.202:develop/test.git

  To prevent you from losing history, non-fast-forward updates were rejected

  Merge the remote changes before pushing again. See the Note about

  fast-forwards section of git push --help for details.

  # git pull //更新代碼,提示沖突

  Address 192.168.10.202 maps to unassigned.psychz.net, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!

  remote: Counting objects: 5, done.

  remote: Compressing objects: 100% (2/2), done.

  remote: Total 3 (delta 0), reused 0 (delta 0)

  Unpacking objects: 100% (3/3), done.

  From 192.168.10.202:develop/test

  367dad3..5e5640b master -> origin/master

  Auto-merging test.txt

  CONFLICT (content): Merge conflict in test.txt

  Automatic merge failed; fix conflicts and then commit the result.

  # vim test.txt //修改沖突文件,并保存

  # git commit -am "remove conflict" //重新提交到本地版本庫

  # git push //同步到遠程

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 中文字幕专区高清在线观看 | 国产91大片 | 爽妇网国产精品 | 黄色一级片在线免费观看 | 蜜桃91麻豆 | 国内精品久久久久久2021浪潮 | 欧美韩国一区 | 中文字幕亚洲一区二区三区 | av观看网站| 久久精品中文字幕一区 | 色999久久久精品人人澡69 | 欧美中文字幕一区二区三区亚洲 | 欧美日韩高清不卡 | 亚洲精品午夜国产va久久成人 | 草草视频免费观看 | 202z中文字幕第一页 | 电影一级毛片 | 操操日日 | 激情欧美在线 | 成人免费看片a | 色播视频在线播放 | 看毛片的网址 | 免费一区在线 | 一区二区三区视频在线播放 | 日韩视频在线一区二区三区 | 国产99久久精品一区二区300 | 男男啪羞羞视频网站 | 在线播放一区二区三区 | 国产精品热 | 91网页视频入口在线观看 | 色诱亚洲精品久久久久久 | 精品国产一级毛片 | 免费一区二区三区 | 日产精品一区二区三区在线观看 | www.狠狠操.com | 午夜免费一区 | 成人毛片视频在线观看 | 久久影院一区二区三区 | 久久艳片 | 99影视在线视频免费观看 | 国产噜噜噜噜久久久久久久久 |