Skip to content

Instantly share code, notes, and snippets.

@zhangguanzhang
Created March 2, 2022 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhangguanzhang/fdb4d3addec113741b8a4e3365f44b48 to your computer and use it in GitHub Desktop.
Save zhangguanzhang/fdb4d3addec113741b8a4e3365f44b48 to your computer and use it in GitHub Desktop.
git 本地 pr 和同步

fork 后本地仓库添加,这里例如 skopeo

  1. 先添加上游
git remote add upstream https://github.com/containers/skopeo.git
  1. 拉取上游
git fetch upstream
  1. 把上游的 main 合并到本地 main
git rebase upstream/main

然后 check -b 一个新分支改了提交,后续 main 分支按照 2,3 步骤操作同步

@zhangguanzhang
Copy link
Author

zhangguanzhang commented Mar 2, 2022

CGO_ENABLED=0 CGO_CFLAGS="" CGO_LDFLAGS="-L/usr/lib64 -lgpgme" GO111MODULE=on  \
     go build -mod=vendor  -ldflags '-X main.gitCommit=49e3c704218c83303251f084d879af87089ba5ef ' \
    -gcflags "all=-trimpath=$PWD  -N -l"  -asmflags "all=-trimpath=$PWD"  \
    -tags "containers_image_openpgp" -o bin/skopeo ./cmd/skopeo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment