NotePad++

官方主页

https://notepad-plus-plus.org

下载地址
https://notepad-plus-plus.org/downloads

GitHub
https://github.com/notepad-plus-plus/notepad-plus-plus

What is Notepad++

Notepad++ is a free (as in “free speech” and also as in “free beer”) source code editor and Notepad replacement that supports several languages. Running in the MS Windows environment, its use is governed by GPL License.

Based on the powerful editing component Scintilla, Notepad++ is written in C++ and uses pure Win32 API and STL which ensures a higher execution speed and smaller program size. By optimizing as many routines as possible without losing user friendliness, Notepad++ is trying to reduce the world carbon dioxide emissions. When using less CPU power, the PC can throttle down and reduce power consumption, resulting in a greener environment.

notepad4ever

I hope you enjoy Notepad++ as much as I enjoy coding it.

1. 回滚到某一提交,并删除后续的提交记录

git reset  --hard cfec6ff
git push origin HEAD --force

2. 回退到上一次commit的状态

git reset --hard HEAD^

3. 回退到任意版本

git reset --hard <commitid>

4. 放弃提交,不推送

git reset --soft HEAD^

仅仅是撤回commit操作,写的代码仍然保留

HEAD^的意思是上一个版本,也可以写成HEAD~1
撤回2次提交,可以使用HEAD~2

--mixed

不删除工作空间改动代码,撤销commit,并且撤销git add
这个为默认参数,git reset --mixed HEAD^git reset HEAD^ 效果是一样的。

--soft

不删除工作空间改动代码,撤销commit,不撤销git add

--hard

删除工作空间改动代码,撤销commit,撤销git add
完成这个操作后,就恢复到了上一次的commit状态。

5. 将分支A的提交,推送到分支B

checkout B
git cherry-pick commitId

[如果有冲突,解决冲突之后

git add
git cherry-pick --continue

]

git push

6. 合并分支时忽略指定文件

.gitattributes中写入

"filename merge=ours":
config.xml merge=ours

在根目录下运行命令行

git config merge.ours.driver true

更新本地分支与远程分支保持一致

git remote update origin --prune

7. 合并部分文件

合并分支B中srv目录下的所有文件和view目录下的index.html文件到A分支

git checkout A
git checkout B srv/** view/index.html

srv下有多层目录,故不能用srv/*





博客内容遵循 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议

总访问量为 次 , Loading day...loading time...