1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| git init
git add .
git add <file_path>
git status
git rm -r --cached .
git commit -m "commit 注释"
git push origin master
git ls-files
git ls-files dir
git rm --cached <file_path>
git remote set-url origin https://github.com/username/repository.git
git config --global core.sshCommand
ssh -T [email protected]
git remote -v
$blobs = git ls-files -s | ForEach-Object { ($_ -split '\s+')[1] }
$totalBytes = 0 foreach ($blob in $blobs) { $size = git cat-file -s $blob 2>$null if ($size) { $totalBytes += [int]$size } }
Write-Host "Staging Area Size (Compressed in Git):" Write-Host "$totalBytes bytes" Write-Host "$([math]::Round($totalBytes / 1KB, 2)) KB" Write-Host "$([math]::Round($totalBytes / 1MB, 2)) MB"
git config --global http.postBuffer size
git ls-files -s | sort -n -k 3
git push origin <branch> git push -u origin <branch> git push -f origin <branch> git push --force-with-lease origin <branch> git push --all origin
git push origin --delete <branch>
git push origin <tagname> git push origin --tags
git push origin --delete <tag_name>
|