bluetoothlover_doc icon indicating copy to clipboard operation
bluetoothlover_doc copied to clipboard

[git]使用技巧总结

Open xupenghu opened this issue 3 years ago • 19 comments

git error: src refspec dev does not match any

提交本地修改到云端时,报这个错误。是因为本地没有创建这个分支。 image 可以新建一个分支,然后再提交

$ git checkout -b wechat_private
$ git push origin wechat_private

xupenghu avatar Dec 13 '21 02:12 xupenghu

可以参考下文档: https://supperthomas-wiki.readthedocs.io/en/latest/WIKI_FAQ/06_git_flow/git_flow.html

supperthomas avatar Dec 13 '21 03:12 supperthomas

git rebase 目前了解到的两种用途:

  1. 多个commit合并成一个 (这个比较有用)
  2. 让git的提交记录变得简介(这个虽然骚气,但是感觉然并软??) image

chenyingchun0312 avatar Dec 13 '21 06:12 chenyingchun0312

在终端使用ohmyzsh的git插件可以简化git大量操作:

  • https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git

hyhkjiy avatar Dec 14 '21 06:12 hyhkjiy

在终端使用ohmyzsh的git插件可以简化git大量操作:

  • https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git

我们对这个还是挺感兴趣的,下次开会可以分享下如何使用的吗?

supperthomas avatar Dec 14 '21 08:12 supperthomas

在终端使用ohmyzsh的git插件可以简化git大量操作:

  • https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git

我们对这个还是挺感兴趣的,下次开会可以分享下如何使用的吗?

Windows上面我也没试过,网上说可以配合MinGW的MSYS使用

hyhkjiy avatar Dec 14 '21 10:12 hyhkjiy

在终端使用ohmyzsh的git插件可以简化git大量操作:

  • https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git

这些,感觉都是一些别名,真正使用的话,其实太多命令的话,感觉别名更不容易记得,还是使用git GUI客户端更好一些吧,我目前使用git extension,感觉还挺好用的

chenyingchun0312 avatar Dec 14 '21 15:12 chenyingchun0312

在终端使用ohmyzsh的git插件可以简化git大量操作:

  • https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git

这些,感觉都是一些别名,真正使用的话,其实太多命令的话,感觉别名更不容易记得,还是使用git GUI客户端更好一些吧,我目前使用git extension,感觉还挺好用的

在命令行的情况下可以用alias + grep快速查找需要的命令还是挺好用的,不过GUI客户端也方便,什么顺手就用什么吧 ^_^

hyhkjiy avatar Dec 15 '21 01:12 hyhkjiy

托管平台: image

supperthomas avatar May 20 '22 05:05 supperthomas

https://mp.weixin.qq.com/s/QI33RSNd7RNExwLQJOLIng

git使用技巧

supperthomas avatar May 20 '22 06:05 supperthomas

45 个 Git 操作场景,专治不会合代码

https://mp.weixin.qq.com/s/36sYeZYX9b-EqHnddZbLxw

supperthomas avatar Aug 23 '22 10:08 supperthomas

程序员必读:Git提交信息和分支创建规范

https://mp.weixin.qq.com/s/aeAxJdBzuU_jmFYQRqhrPA

supperthomas avatar Aug 23 '22 13:08 supperthomas

https://mp.weixin.qq.com/s/gooJKTZ6Sio7Q7Ls2kapxw 45个常见场景

supperthomas avatar Jan 08 '23 15:01 supperthomas

Git基本原理介绍

https://mp.weixin.qq.com/mp/publictag?action=get&tag_id=1993325228658262017&start=0&count=10&scene=1&sessionid=&enterid=0&from=groupmessage#wechat_redirect

supperthomas avatar Jan 13 '23 12:01 supperthomas

git pull --rebase 巧用git diff

supperthomas avatar Mar 14 '23 13:03 supperthomas

如何显示两个branch之间文件名差异

你可以使用以下 git 命令来获取 branch1branch2 之间差异的文件名及路径:

git diff --name-only branch1 branch2

这个命令会输出 branch1branch2 之间所有发生变更的文件的文件名及路径。如果你想要一个更详细的输出,包括文件差异的统计信息,可以使用 --stat 选项:

git diff --stat branch1 branch2

supperthomas avatar Apr 04 '23 14:04 supperthomas

diff_files=$(git diff --name-only $base_branch..$compare_branch)

# 对每个差异的文件进行处理
for file in $diff_files; do
    # 在这里添加你要执行的操作
    echo "Processing file: $file"
    # 假设你要执行的操作是将文件复制到另一个目录中
    cp $file /path/to/destination/
done

supperthomas avatar Apr 04 '23 14:04 supperthomas

git diff --name-only 可以显示当前差异文件。

supperthomas avatar Apr 25 '23 07:04 supperthomas

修改git默认编译器为vim

git config --global core.editor "vim"

supperthomas avatar Sep 16 '24 01:09 supperthomas