t
to find a file by names
to search- Use
commenter:<blah>
to find every issue that<blah>
commented on.
git clone https://@github.com/username/repo.git
git clone https://oauth2:@github.com/username/repo.git
git tag
git show <tagname>
git tag <tagname> <commithash>
After creating a tag using command above.
git push --tags # for everything
git push <tagname>
git tag -d <tag>
git push origin :refs/tags/<tag>
git push --delete origin <tag>
git fetch --prune origin "+refs/tags/*:refs/tags/*"
# delete all tags that start with test_ both locally and on remote
git fetch --prune origin "+refs/tags/*:refs/tags/*" && git tag --list | ? { $_.StartsWith("test_") } | % { git push origin --delete $_ }
git tag -a annotated-azure-template_0.0.1 -m "this is an annotated tag" git push origin :refs/tags/annotated-azure-template_0.0.1
This is supported for commits to Azure Repos Git, Bitbucket Cloud, GitHub, and GitHub Enterprise Server.
[skip ci] or [ci skip]
skip-checks: true or skip-checks:true
[skip azurepipelines] or [azurepipelines skip]
[skip azpipelines] or [azpipelines skip]
[skip azp] or [azp skip]
***NO_CI***
git fetch origin pull/$ID/head:$BRANCHNAME
git checkout $BRANCHNAME
Moving files up the tree goes "wonky" on Windows machines. Recommendation is to use git bash
.
Note: remember that
drives
don't show up properly ongit bash
.cd / && ls
won't show the disks. Just access the disk as a root folder. EG:C:/repo/sdk-tools
turns into/c/repo/sdk-tools
.
Furthermore, you will need to remember to add a target .
in the suffix of the target path. EG:
# pwd -> /c/repo/sdk-tools/packages/python-packages
# move all files _below_ target folder under another target folder
git mv ./api-stub-generator/* ./apiview-stub-generator/.
If you attempt to push, and are getting issues with
This token is not configured for SSO
Or related issues like that, you probably need to try doing git config --global credential.helper manager-core
to force it to actually work with SAML SSO.
Reference git-ssh.md. Or the gist.
Authorization using PAT
$headers = @{
"Accept" = "application/vnd.github+json"
"Authorization" = "token $gh_token"
}
Invoke-RestMethod -Method GET -Uri "https://api.github.com/repos/azure/azure-sdk-assets-integration" -H $headers
This will work because the powershell Invoke-RestMethod
will set the default User-Agent
header FOR YOU. Github will reject any API requests that do not specify a
User-Agent with a 403 Forbidden
. They don't mandate any specific one, just that one is provided.
await octokit.request('GET /repos/{owner}/{repo}/releases', { owner: 'octocat', repo: 'hello-world' })
@{ Authorization="Bearer $key"}
curl
-H "Accept: application/vnd.github.v3+json"
https://api.github.com/repos/octocat/hello-world/releases
curl -i -u https://api.github.com/sbeddall/locker/releases -H "Authorization: token $gh_token"
curl -H "Authorization: token $gh_token" -i https://api.github.com/sbeddall/locker/releases
$headers = @{ "Content-Type" = "application/json" "Authorization" = "token $gh_token" }
#auth #rest #gitapi