programming:git
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| programming:git [2019/03/15 11:49] – created clemix | programming:git [2019/12/09 14:21] (current) – clemix | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| git push git@github.com: | git push git@github.com: | ||
| </ | </ | ||
| + | |||
| + | ====== Exclude file from last commit ====== | ||
| + | <code bash> | ||
| + | git reset --soft HEAD~1 | ||
| + | </ | ||
| + | Then unstage unwanted files | ||
| + | <code bash> | ||
| + | git reset HEAD path/ | ||
| + | </ | ||
| + | Now commit again, you can even re-use the same commit message: | ||
| + | <code bash> | ||
| + | git commit -c ORIG_HEAD | ||
| + | </ | ||
| + | ====== Checkout PR from github on a new branch ====== | ||
| + | <code bash> | ||
| + | #!/bin/bash +x | ||
| + | |||
| + | pr_url=" | ||
| + | target_repo_part=${pr_url%%/ | ||
| + | pr=" | ||
| + | pr_url=${target_repo_part/ | ||
| + | pr_content=$(curl " | ||
| + | label=$(echo " | ||
| + | user=$(echo " | ||
| + | repo_name=" | ||
| + | branch=" | ||
| + | repo=" | ||
| + | |||
| + | echo " | ||
| + | echo " | ||
| + | echo " | ||
| + | echo " | ||
| + | |||
| + | |||
| + | echo git checkout -b " | ||
| + | git checkout -b " | ||
| + | echo git pull " | ||
| + | git pull " | ||
| + | </ | ||
| + | |||
| + | |||
programming/git.1552646945.txt.gz · Last modified: by clemix
