
git
hushui
Coding Since 1998
展开
-
using a local_manifest.xml with repo
cp your_local_mainifest.xml .repo/manifestsrepo init -m your_local_manifest.xmlrepo sync原创 2021-11-08 16:02:49 · 381 阅读 · 1 评论 -
git filter-branch --subdirectory-filter
git 库buildrootlinux2个子目录 放弃buidlroot将linux提升为根目录 , 保持git日志不变-bash-4.2$ git clone https://github.com/Broadcom/stblinux-4.9.gitCloning into 'stblinux-4.9'...remote: Enumerating objects: 201985, done.remote: Counting objects: 100% (7916/79...原创 2021-10-09 14:16:05 · 580 阅读 · 0 评论 -
git change email by filter-branch/set local git email
[lake@localhost linux-stable]$ git config --global alias.change-commits '!'"f() { VAR=\$1; OLD=\$2; NEW=\$3; shift 3; git filter-branch --env-filter \"if [[ \\\"\$\`echo \$VAR\`\\\" = '\$OLD' ]]; then export \$VAR='\$NEW'; fi\" \$@; }; f"[lake@localhost.原创 2021-10-09 13:39:58 · 356 阅读 · 0 评论 -
git remote tag fetch one
[lake@localhost buildroot]$ git fetch origin --tagsremote: Enumerating objects: 23716, done.remote: Counting objects: 100% (19099/19099), done.remote: Compressing objects: 100% (9145/9145), done.remote: Total 15644 (delta 11018), reused 9843 (delta 64.原创 2021-09-30 10:11:19 · 172 阅读 · 0 评论 -
git/windows/powershell
Set startup script of powershellC:\Users\yourname> New-Item $profile -Type File -Force Directory: C:\Users\yourname\Documents\WindowsPowerShellMode LastWriteTime Length Name---- ------------- ...原创 2021-09-28 15:22:38 · 161 阅读 · 0 评论 -
git show remote branch before fetch
[lake@localhost u-boot]$ git remote add friendlyELEC-Rockchip https://github.com/friendlyarm/uboot-rockchip.git[lake@localhost u-boot]$ git remote show friendlyELEC-Rockchip* remote friendlyELEC-Rockchip Fetch URL: https://github.com/friendlyarm/ub.原创 2021-09-14 16:41:15 · 430 阅读 · 0 评论 -
git stash one file only
[lake@localhost test]$ git stash push -p -m "Bcm error label" ./testgit/brm.cppdiff --git a/testgit/brm.cpp b/testgit/brm.cppindex 4441dbf5be9..7b270c4e473 100644--- a/testgit/brm.cpp+++ b/testgit/brm.cpp@@ -1133,6 +1133,7 @@ bool convertCSt.原创 2021-09-14 10:50:37 · 158 阅读 · 0 评论 -
git log VS whatchanged
[lake@localhost gittest]$ git log --statcommit 65af7420e5fb32962d05d65f9603b2bac278f62eAuthor: XXXXXDate: Wed Jun 9 16:47:09 2021 +0800 Continue Revert Workapplications/Test.cpp | 23 -----------------------1 file changed, 23 deletions(...原创 2021-06-30 10:01:58 · 139 阅读 · 0 评论 -
git tips / git log merge
## log merge only on master[lake@localhost ]$ git log --merges master# find old commit e88ac1e4a2ee from which merge into master [lake@localhost ]$ git log e88ac1e4a2ee..master --ancestry-path --merges --reverse原创 2021-05-12 17:18:25 · 190 阅读 · 0 评论 -
git remote clone one commit
1. with remote branch name or tag namegit clone -b v4.19 --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.gitgit clone --depth 1 --branch sshfs_2_5 https://github.com/libfuse/sshfs2. without remote b...原创 2021-03-15 14:00:24 · 197 阅读 · 0 评论 -
git command tips: git switch branch without checkout
[lake@localhost testgit]$ git branch* master test[lake@localhost testgit]$ git symbolic-ref HEAD refs/heads/test[lake@localhost testgit]$ git branch master* test[lake@localhost testgit]$ lsmaster.txt test.txt[lake@localhost testgit]$ git statu...原创 2021-02-22 20:06:18 · 147 阅读 · 0 评论 -
git remote tag/branch without fetch
[lake@localhost refsw-prime]$ git remote -vvorigin ssh://git@git.yourcompany.com/mirror/broadcom/bse_refsw/refsw-prime (fetch)origin ssh://git@git.yourcompany.com/mirror/broadcom/bse_refsw/refsw-prime (push)refsw-common ssh://git@git.yourcompany..原创 2021-01-28 14:47:55 · 192 阅读 · 0 评论 -
git clone --depth 1 --branch branch/tag_name remoteurl
[lake@localhost source]$ git clone --depth 1 --branch sshfs_2_5 https://github.com/libfuse/sshfsCloning into 'sshfs'...remote: Enumerating objects: 19, done.remote: Counting objects: 100% (19/19), done.remote: Compressing objects: 100% (18/18...原创 2021-01-27 16:00:49 · 367 阅读 · 0 评论 -
git big-files
Refer togit command tips: big files and remove in all brancheshttps://blog.youkuaiyun.com/hushui/article/details/1033616631. git find big fileslake@localhost: aosp_git_android$ git rev-list --all | xargs -rL1 git ls-tree -r --long | sort -u...原创 2021-01-23 13:35:20 · 304 阅读 · 1 评论 -
git gc completely完全清除历史垃圾
git remote prune origin && git repack && git prune-packed&& git reflog expire --expire-unreachable=now --all --expire=all&& git gc --prune=now --aggressive原创 2021-01-23 10:21:26 · 841 阅读 · 0 评论 -
Git with bundle import
Refer tohttps://git-scm.com/docs/git-bundleExample Firefly RK3399Pro git with bundle update[lhu3@zch127bld08 AIO-3399Pro]$ git logcommit d6d1fd2457640156ca00cbdb3da0f2ea7b603e6c (HEAD -> master)Author: Firefly <service@t-firefly....原创 2021-01-10 18:45:16 · 975 阅读 · 0 评论 -
git command tips: branch relation --simplify-by-decoration/merge-base
Examplelog --graph --decorate --oneline --simplify-by-decoration[lhu3@zch127bld08 spice-gtk]$ git logb remotes/origin/dev remotes/origin/master* b1d3942 (HEAD -> dev, origin/dev, origin/HEAD) Update build.bat* 8168896 Merge branc...原创 2020-10-28 10:36:14 · 221 阅读 · 0 评论 -
git remote add/git ls-remote --heads
$ git remote add brm ssh://lake@server:/home/lake/extra/MyGitResp-brmlake@PC-Win10 MINGW64 /c/Lake/git.local-win10 (master)lake@PC-Win10 MINGW64 /c/Lake/git.local-win10 (master)$ git ls-remote --heads brmWarning: No xauth data; using fake au.原创 2020-10-14 08:55:07 · 1777 阅读 · 0 评论 -
git fetch wihout branch check
git fetch --all ////fetch no pull or merge//fetch and merge without branch checkoutgit fetch origin master:master原创 2020-07-24 10:34:21 · 133 阅读 · 0 评论 -
git command tips: Search
1. Serach authorgit log --author=<pattern>git whatchanged --author="Lake Hu"commit XXXXXXX(HEAD -> lakedebug)Author: Lake Hu < >Date: Wed Jul 15 13:14:32 2020 +08002. grep[lhu3@zch127bld08 plain-linux]$ git log -G"Deb...原创 2020-07-23 10:25:50 · 144 阅读 · 0 评论 -
RHEL7.2/Centos git web 1. instaweb 2. gitweb with Apache
1. Build with sourceDefault, git/v1.8.3.1 on RHEL/Centos7 does not have git instaweb program.git clone -b v1.8.3.1 --depth 1 https://github.com/git/git.gitmakemake install (Default into $HOM...原创 2018-03-19 15:08:01 · 236 阅读 · 0 评论 -
Gogs/MySQL 5.7.28/Windows
gogs_0.11.91_windows_amd64_mws mws/Microsoft Windows ServicePlease start gogs.exe from git/bash hushui@Hushui MINGW64 /d/git-yl/Win/gogs_0.11.91_windows_amd64_mws$ ./gogs.exe web2020/06/15 17:04:28 [ WARN] Custom config 'D:/git-yl/Win/gogs_0....原创 2020-06-15 18:27:59 · 371 阅读 · 0 评论 -
Gogs/mariadb(x86-64) = 1:5.5.65-1.el7 Centos7/Aliyun
1.gogs_0.11.91_linux_amd64.tar.gzhushui@Hushui:/mnt/d/gogs$ scp gogs_0.11.91_linux_amd64.tar.gz git@47.100.203.63:/home/git/git@47.100.203.63's password:gogs_0.11.91_linux_amd64.tar.gz 100% ...原创 2020-06-15 16:28:00 · 724 阅读 · 0 评论 -
Gogs/MySQL 5.7.28 Community Server Centos7
### MySQL 5.7.28 Community Server Centos7[lake@localhost opt]$ netstat -an --tcp |grep 3306tcp6 0 0 :::3306 :::* LISTEN[lake@localhost opt]$ systemctl status mysqld● mysqld.service - MySQL Server ...原创 2020-06-11 11:32:07 · 295 阅读 · 0 评论 -
git gc/clean/pack
rm -Rf .git/refs/originalgit reflog expire --expire=now --allgit gc --prune=now --aggressive --force原创 2020-01-15 15:42:20 · 319 阅读 · 0 评论 -
git search files
### find all *.pyc files in all commitsgit log --all --name-only --pretty=oneline *.pyc### find all *.jpgfiles in all commits$git ls-files *.jpgprebuilts/go/linux-x86/doc/gopher/penc...原创 2020-01-13 15:06:42 · 416 阅读 · 0 评论 -
git branch local/remote set/unset
git fetch <remote> <sourceBranch>:<destinationBranch>git branch --set-upstreamExample: git branch --set-upstream-to=origin/remote_branch your_branchgit branch --unset-u...原创 2019-12-18 13:52:28 · 231 阅读 · 0 评论 -
git command tips: big files and remove in all branches (搜索大文件并在所有branch删除 git filter-branch -f !!)
git rev-list --all | xargs -rL1 git ls-tree -r --long | sort -uk3 | sort -rnk4 | head -10lake@localhost: aosp_git_android$ git rev-list --all | xargs -rL1 git ls-tree -r --long | sort -uk3 | sort -...原创 2019-12-03 09:47:53 · 404 阅读 · 0 评论 -
Fetch remove git server's patch only to avoid clone/download all
git@gitlab.com:TeeFirefly/FireNow-Nougat.githttps://gitlab.com/TeeFirefly/FireNow-Nougat.githttps://github.com/foo/bar/commit/${SHA}.patchExample:https://gitlab.com/TeeFirefly/FireNow...原创 2019-11-18 15:17:46 · 307 阅读 · 0 评论 -
git branch/tag search with commited id///Find the most recent common ancestor of two branches
1.git branch --contains <commit>$ git branch --contains d590f2 tests* mastergit branch --contains <commit> Only list branches which contain the specified commit (HEAD if not...原创 2019-10-16 10:21:21 · 252 阅读 · 1 评论 -
Ubuntu16.04.10 kernel built with Linux 4.19.9/Dec 13, 2018 with GRUB2
Linux kernel stable gitgit clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.gitTag git tag/v4.19.9commit be53d23e68c29900da6b6ce486b5ab8507de94b1Author: Greg Kroa...原创 2018-12-14 20:21:45 · 444 阅读 · 0 评论 -
git command tips: clone Linux kernel stable git ( --depth 1 )
Linux kernel stable gitgit clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.gitLTS/LongTermSupport Linux Kernel Versiongit clone -b v4.19 --depth 1 ...原创 2018-11-25 20:10:11 · 344 阅读 · 0 评论 -
git command tips: find big file in commit history
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -10 | awk '{print$1}')"原创 2018-11-09 21:59:00 · 866 阅读 · 0 评论 -
git command tips: sort in one commit
lake@localhost:/Google/git-aosp-AndroidN7.1.x$ git whatchanged 002876bb630547d4f27189be81f6ab9e2d8acf4d^..002876bb630547d4f27189be81f6ab9e2d8acf4d commit 002876bb630547d4f27189be81f6ab9e2d8acf...原创 2018-11-09 21:47:31 · 230 阅读 · 0 评论 -
git command tips: pull from a copied repository
#### Copy git repository from someone elselake@localhost:~/Rockchip/FireFly-RK3399/7.1.2$ git pull --all Fetching gitlabWarning: Permanently added the ECDSA host key for IP address '35.231.145.15...原创 2018-11-06 09:39:57 · 299 阅读 · 0 评论 -
rsync/git/repo/android source of AOSP
lake@localhost:~/Google$ cat rsync-exclude-from.txt.repo.git/.gitignore /outlake@localhost:~/Google$rsync -r -l -t --exclude-from "rsync-exclude-from.txt" --delete --p...原创 2018-10-29 15:29:31 · 378 阅读 · 0 评论 -
RHEL/Centos7 Shell tips: git/awk/sort/uniq
lake@localhost:~/Google/git-android-8.1.0_r33$ git whatchanged device |awk -F/ '{print $2}' |sort |uniq asuscommongenericgooglehuaweilgelinarosamplelake@localhost:~/Google/git-android-8.1...原创 2018-10-29 15:27:16 · 187 阅读 · 0 评论 -
RHEL/Android/Git/repo loop
lake@localhost:~/Google/android-8.1.0_r33$ cat ~/git_repository/repo-repeat.sh#!/bin/bashrepo syncwhile [ $? -ne 0 ]do sleep 10 repo syncdone原创 2018-10-25 13:29:32 · 159 阅读 · 0 评论 -
RHEL/Android/Git/repo switch branch in AOSP source
lake@localhost:~/Google/android-8.1.0_r33$cd .repo/manifestslake@localhost:~/Google/android-8.1.0_r33/.repo/manifests$ git branch -a | grep android-8.1.0_r33 remotes/origin/android-8.1.0_r33la...原创 2018-10-25 13:28:38 · 455 阅读 · 0 评论 -
RHEL7/Ubuntu system Proxy for Linux global system or git
1. Gnome GUI2. Samelake@localhost:~$ export |grep httdeclare -x HTTP_PROXY="http://10.24.1.1:8080/"declare -x http_proxy="http://10.24.1.1:8080/"lake@localhost:~$ export |grep proxy...原创 2018-07-06 14:13:30 · 407 阅读 · 0 评论