jQuery鼠标指针特效

GIT 学习记录

//抓取关键日志,自带过滤
adb shell 
logcat -b events | grep -E "boot_progress|sf_stop_bootanim|wm_boot_animation_done"

adb shell input keyevent 4  back   3 home 

adb shell "dumpsys activity top | grep '#[0-9]: ' | tail -n 1"  获取Settings当前界面的Fragment

adb shell 
dumpsys window | grep  mCurrentFocus (查看前台activity)
service list | grep lyl (查看系统服务,grep 遍历搜索)
settings list system (查看系统settings-system属性)


//Linux命令
find ./ -name "*.xml" |xargs grep "status_bar_height"  高效搜索

//主分支 下 拉取另外的远端子分支

git branch  name (远端分支名)

git checkout name

git reset -- hand xxxx(commit_id) 先重置 再更新
git pull origin rk3566-xx:rk3566-xx


//本地代码和服务器产生链接
git branch  name  (远端分支名)
git checkout name
git reset --hard xxxx 先重置 再更新
git pull origin rk3566-xx:rk3566-xx

git log --oneline  查看很多git 提交日志

gitk  git图形化界面的插件
git show  xxx  --name-only    不看明细,只看修改了那些文件
git cherry-pick  commitid  合并commit

//推送和拉取远端的代码
git pull origin rk3566-xx:rk3566-xx
git push origin rk3566-xx:rk3566-xx


git init --bare	git初始化服务器仓库

git init 	初始化本地仓库

git add . 	本地仓库添加

git commit -m "first version" 	本地仓库首次提交

===本地仓库关联服务器远程仓库===
git remote add origin https://github.com/xxxx/frp.git 或者
git remote add origin name@192.168.x.xxx:/home/data/xx/xxx/frp.git
name是服务器账户用户名

git push origin master 	本地仓库push到服务器

git remote rm origin	删除远程仓库

#git remote -v  查看项目的地址(在远程服务器的地址)
origin  xxxx:/xxx/xxx/ (fetch)
origin  xxxx:/xxx/xxx/ (push)

git branch -a(查看所有分支包括本地分支和远程分支).
git branch -r(查看远程分支).

git checkout -b branchname  --->(等价于) git branch branchname + git checkout branchname.(建立一个新分支,然后切换到该分支)

git push origin branchname (将新分支推送至GitHub或服务器)

git branch -d branchname  (删除本地分支)
git push origin :branchname  (推送到服务器,删除远程分支)
git push origin --delete branchname

git clone -b develop XXX.git   (XXX.git --->项目地址)
develop -->分支名称  

git reset 7ac2de1883ed2853f547ca 回退代码


在Git中,打补丁是一种常用的操作,主要用于代码审查、代码迁移等场景
Git提供了两种主要的补丁方案:一种是通过git diff生成的.diff文件,另一种是通过git format-patch生成的.patch文件

一、patch和diff的区别

.diff文件:git diff命令生成的.diff文件仅记录文件改变的内容,而不包含commit记录信息。多个commit可以合并成一个diff文件。这种文件通常用于记录代码更改的详细信息,方便查看和比对。

.patch文件:git format-patch命令生成的.patch文件不仅记录文件改变的内容,还包含commit记录信息。每个commit对应一个patch文件。这种文件通常用于保存和传输代码的更改,方便在不同的代码库之间迁移和合并


创建.diff文件

使用git diff命令可以创建.diff文件。例如,要比较当前分支与上一次提交的差异,可以执行以下命令:
git diff > diff.txt

创建.patch文件

使用git format-patch命令可以创建.patch文件。例如,要创建从某个commit到当前commit的所有patch文件,可以执行以下命令:
git format-patch --root
这将生成一系列以.patch为后缀的文件,每个文件对应一个commit的更改。你可以将这些文件保存起来,以便在其他地方应用这些更改

另外,你还可以指定要创建patch文件的范围。例如,要创建从commit A到commit B之间的所有patch文件,可以执行以下命令:
git format-patch commit_A..commit_B

三、应用patch和diff

应用.diff文件
使用git apply命令可以应用.diff文件。例如,要将一个名为diff.txt的.diff文件应用到当前分支,可以执行以下命令:

git apply diff.txt
这将把diff.txt文件中记录的更改应用到当前分支上。

应用.patch文件
使用git am命令可以应用.patch文件。例如,要将一个名为patch.patch的.patch文件应用到当前分支,可以执行以下命令:

git am --3way patch.patch
这将把patch.patch文件中记录的更改应用到当前分支上。注意,--3way选项允许Git自动解决一些简单的冲突。

posted @ 2023-04-25 09:37  僵小七  阅读(23)  评论(0)    收藏  举报