Skip to content

Instantly share code, notes, and snippets.

@adis-io
Created May 13, 2022 13:50
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 adis-io/e155d73a82f6c3f6c0f0f7d8cb8d9c03 to your computer and use it in GitHub Desktop.
Save adis-io/e155d73a82f6c3f6c0f0f7d8cb8d9c03 to your computer and use it in GitHub Desktop.
How jenkins initializes repo
mkdir <dir>
git init .
git fetch --no-tags --force --progress -- https://github.com/<org>/<repo>.git +refs/heads/<branch>:refs/remotes/origin/<branch>
git config remote.origin.url https://github.com/<org>/<repo>.git
git config --add remote.origin.fetch +refs/heads/<branch>:refs/remotes/origin/<branch>
git config core.sparsecheckout
git checkout -f <sha>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment