使用staf暂存分支
index.less写了
@media screen and (max-width:1360px){
.nav-0518 > div {
width: 1200px;
margin: 0 auto;
}
}
保存暂存区,新建分支写文字:
PS D:\dnmp\www\www.abc.com> git stash
warning: LF will be replaced by CRLF in public/css/index.css.
The file will have its original line endings in your working directory.
Saved working directory and index state WIP on html: c48a074 goods/index.html 修改文字‘政策
PS D:\dnmp\www\www.abc.com> git stash list
stash@{0}: WIP on html: c48a074 goods/index.html 修改文字‘政策
新分支写了东西,提交了。切换回来发现东西不在了
PS D:\dnmp\www\www.abc.com> git checkout -b newhtml
Switched to a new branch 'newhtml'
M public/css/index.css
M public/css/index.less
PS D:\dnmp\www\www.abc.com> git add .
warning: LF will be replaced by CRLF in public/css/index.css.
The file will have its original line endings in your working directory.
PS D:\dnmp\www\www.abc.com> git commit -m "index.less,index.css 缩小版样式修改开始"
[newhtml 0f8909b] index.less,index.css 缩小版样式修改开始
1 file changed, 2 insertions(+), 1 deletion(-)
PS D:\dnmp\www\www.abc.com> git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
PS D:\dnmp\www\www.abc.com> git checkout html
Switched to branch 'html'
gitstashpop就回来了:
PS D:\dnmp\www\www.abc.com> git stash pop
On branch html
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: public/css/index.css
modified: public/css/index.less
no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (f2e1dfdec076a7b0a9ae85c6e06b437ce5294aa4)