Git常用命令隨記

24KB發表於2019-04-08

1、git checkout -- fileName 丟地本地工作區內容 例子: 第一次git pull 時,error: Your local changes to the following files would be overwritten by merge: consultitem-core/src/main/java/com/pajk/consultitem/core/service/http/ArchiveManagerHttpServiceImpl.java Please commit your changes or stash them before you merge. Aborting Updating 201bd6f..c2ddc83

此時,使用git checkout -- consultitem-core/src/main/java/com/pajk/consultitem/core/service/http/ArchiveManagerHttpServiceImpl.java後,可以pull成功

2、git checkout branchName 切換分支

相關文章