gh auth login # ¥í¥°¥¤¥ó¥¹¥Æ¡¼¥¿¥¹ gh auth status # ¥¢¥«¥¦¥ó¥ÈÀÚ¤êÂؤ¨¡£¥È¥°¥ëÆ°ºî gh auth switch
µ»ö:
# ºîÀ®¼Ô author:<user name> is:issue is:PR is:open is:closed
```[tasklist] # title - [ ] task1 - [ ] task2 ```
MS Learn:
µ»ö:
µ»ö:
/.ssh/known_hosts ¤«¤égithub.com¤òºï½ü¡£¤½¤Î¸å¡¢ºÆÅÐÏ¿
ssh-keygen -R github.com curl -L https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >> ~/.ssh/known_hosts
ssh -T git@github.com ... Offending key for IP in /home/user1/.ssh/known_hosts:51 Matching host key in /home/user1/.ssh/known_hosts:53 Are you sure you want to continue connecting (yes/no)? yes
µ»ö:
<details> <summary></summary> ```shell ``` </details>
¥Ç¥Õ¥©¥ë¥È¤Ç¤Ïgit commit¤Ëemail¤¬´Þ¤Þ¤ì¤ë¤¿¤á¡¢public repo¤Ë¥³¥ß¥Ã¥È¤¹¤ë¤Èbot¤Ë¥¯¥í¡¼¥ë¤µ¤ì¤Æspam¤¬Íè¤ë¡£
Âкö:
git config user.email "<number>+<user>@users.noreply.github.com" # ¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¤Ç¤¤Æ¤¤¤ë¤«¸¡¾Ú ssh -T git@github.com Hi <user>! ...
µ»ö:
µ»ö:
µ»ö:
µ»ö:
mermaidµË¡
µ»ö:
¤½¤Î¾¤ÎÁªÂò»è¡£AWS¥¢¥¤¥³¥óÅù¤ò»È¤¤¤¿¤¤¤Ê¤É
µ»ö:
µ»ö:
Secret scanning¤Ï¥Ñ¥Ö¥ê¥Ã¥¯¥ê¥Ý¥¸¥È¥êµÚ¤ÓAdvanced Security¥é¥¤¥»¥ó¥¹¤ò»ý¤ÄOrganization¤¬½êͤ¹¤ë¥×¥é¥¤¥Ù¡¼¥È¥ê¥Ý¥¸¥È¥ê¤ÇÍøÍѤǤ¤Þ¤¹¡£
- Enterprise ¥×¥é¥ó¤Ë¤Ï´Þ¤Þ¤ì¤Æ¤¤¤ë
2021-04¸½ºß¡¢É¸½àµ¡Ç½¤Ë¤Ï¥Á¥ã¡¼¥ÈºîÀ®¤Ï̵¤¤
GanttStart: 2020-04-27 GanttDue: 2020-05-08
ERROR: Repository not found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
³Îǧ:
ssh-add -l # ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¸ø³«¸°¤¬É½¼¨¤µ¤ì¤ë¡£ ssh -T git@github.com # github¤Î¥æ¡¼¥¶Ì¾¤¬É½¼¨¤µ¤ì¤ë
/.ssh/config ¤Ç¡¡ControlMaster auto ¤À¤ÈControlPersist¤Ë»ØÄꤵ¤ì¤¿»þ´Ö¥¥ã¥Ã¥·¥å¤µ¤ì¤ë¡£¤½¤Î»þ´Ö¤ò·Ð²á¤¹¤ì¤Ð¡¢¥¥ã¥Ã¥·¥å¤¬ÀÚ¤ì¤ë¤Î¤ÇÀܳ¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤ë¤Ï¤º¡£
²ò·è: ControlMaster ¤òÌÀ¼¨Åª¤ËÀÚÃǤ¹¤ë
# ¸½ºß¤ÎÀܳ¤ò³Îǧ ssh -O check git@github.com # Àܳ¤¬»Ä¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢½ªÎ» ssh -O exit git@github.com
͸ú²½¼ê½ç:
local¤Ë¤¢¤ë¡Öfile:///var/www/svn/dev/¡×¤ògithub private repo¤Ø°Ü¹Ô¤¹¤ë:
mkdir -p git-svn/dev/ cd git-svn/dev/ # svn¤Îrev¤ò³Îǧ svn info file:///var/www/svn/dev/
svn ls file:///var/www/svn/repo/ branches/ tags/ trunk/ git svn init -s --prefix=svn/ --no-minimize-url file:///var/www/svn/dev/
svn ls file:///var/www/svn/repo/ dir1 dir2 ... git svn init -s --prefix=svn/ --no-minimize-url --trunk=/ file:///var/www/svn/dev/
git svn fetch
git remote add origin git@github.com:<user>/<repo>.git git branch -M master git push -u origin master
git remote -v origin git@github.com:<YOUR_USER>/<REPO>.git (fetch) origin git@github.com:<YOUR_USER>/<REPO>.git (push)
git remote add upstream https://github.com/<ORIGINAL_USER>/<REPO>.git
git fetch upstream
git checkout master git pull -p git merge upstream/master
git diff origin/master git push origin master
¢¨GitHub actions¤Ë¡Öworkflow_dispatch¡×¤¬Äɲ䵤줿¤Î¤Ç¡¢¼êÆ°¤Ç¤Î¥Æ¥¹¥È¤Ï¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿
PR¤òºî¤ë»þ¤ËÁªÂò¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
PR¤òDraft¤ØÌ᤹¡£
PR¤Î¥ì¥Ó¥å¡¼Ãæ¤Ë¡¢¿ô¹Ô¤ÎÊѹ¹¤òÄó°Æ¤·¤¿¤¤¾ì¹ç¤ËÊØÍø¡£
GitHub¤Îµ¬ÌóŪ¤Ë¤Ï¡£
IPÀ©¸Â¤ò¤·¤Æ¤¤¤ë¾ì¹ç¡¢GitHub¤ÎIP¤òµö²Ä¤¹¤ëɬÍפ¬¤¢¤ë¡£
curl -s https://api.github.com/meta | jq .
jobs: dump_contexts_to_log: runs-on: ubuntu-latest steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - name: Dump job context env: JOB_CONTEXT: ${{ toJson(job) }} run: echo "$JOB_CONTEXT"
µ»ö:
µ»ö:
µ»ö:
```¸À¸ì¤Î̾Á° or aliases ¥³¡¼¥É ```
GitHub¾å¤Ç¡¢¥Ö¥é¥ó¥Á¡¢¥³¥ß¥Ã¥ÈID´Ö¤ÎÈæ³Ó¤¬¤Ç¤¤ë¡£
¥ì¥Ó¥å¡¼¤¹¤ë¿Í¤ÎÉéô¤¬¸º¤ë¡£
GUI¤Î¾ì¹ç:
URL¤«¤éľÀÜÆþÎϤ¹¤ë¾ì¹ç:
https://github.com/example/example/compare/<commit-id , branch , tag>...<commit-id , branch , tag>
# ºî¶ÈÍÑ¥Ö¥é¥ó¥ÁºîÀ® git co -b add/prod # stg¤«¤éprod¤Ø¥³¥Ô¡¼ cp -R stg prod # ½ÅÍס£¤³¤Îcommit-id¤¬Èæ³Ó¸µ¤Ë¤Ê¤ë¡£Îã: 1234abc git add prod git commit # prod/°Ê²¼¤òÊѹ¹¤·¤Æcommit git commit git push origin add/prod # stg¤Èprod¤ÎÈæ³ÓÍÑ¥ê¥ó¥¯¤Ç³Îǧ¤·¡¢PRÅù¤ËµºÜ https://github.com/example/example/compare/1234abc...add/prod
Îã:
git commit --author='User1 <user1@example.com>' -a
git config user.name "user1" git config user.email "user1@example.com"
GitHub¤Ï¥Ç¥Õ¥©¥ë¥È¤ÇÀµ¤·¤¤ÈëÌ©¸°¤¬»ØÄꤵ¤ì¤ë¤è¤¦¤À¤¬¡¢BitBucket¤Ç¤ÏÈëÌ©¸°¤òÌÀ¼¨Åª¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤Ã¤¿
vim ~/.ssh/config ---- Host bitbucket.org User git Port 22 HostName bitbucket.org IdentityFile ~/.ssh/github_rsa TCPKeepAlive yes IdentitiesOnly yes ----
ssh-rsa AAAAB3N...YFd8w6Q== username@example.com
ssh -T git@github.com Hi <UserName> ...
# ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¸°¤ò³Îǧ ssh-add -l # ¥æ¡¼¥¶Ì¾¤¬Àµ¤·¤¤¤«³Îǧ ssh -T git@github.com # ´Ö°ã¤Ã¤Æ¤¤¤ë¾ì¹ç¡£¸½ºß¤ÎÀßÄê¤òºï½ü ssh-add -D
git commi -m "#1 fixed" git commi -m "#1 closed"
Êѹ¹ÅÀ¤ò´Þ¤ó¤À¥Ö¥é¥ó¥Á¤ò¸µ¥ê¥Ý¥¸¥È¥ê¤Ë¼è¤ê¹þ¤ó¤ÇÌ㤦¤è¤¦¤Ë¥ê¥¯¥¨¥¹¥È¤òÅꤲ¤ë»ö
# ¸½ºß¤Îbranch³Îǧ git branch -a * master # ºÇ¿·¤Îmaster¤Ë¹¹¿· git pull # ºî¶ÈÍÑ¥Ö¥é¥ó¥ÁºîÀ®¤È¥Á¥§¥Ã¥¯¥¢¥¦¥È git checkout -b new-branch # ¸½ºß¤Îbranch³Îǧ git branch master * new-branch # ¥Õ¥¡¥¤¥ë¤òÊѹ¹¡¢Äɲà # Êѹ¹ÅÀ³Îǧ git diff . # ÌäÂê¤Ê¤±¤ì¤Ð¥³¥ß¥Ã¥È git commit . # ¥Ö¥é¥ó¥Á¤ò¥ê¥â¡¼¥È¤Ø¥×¥Ã¥·¥å git push origin new-branch
git checkout master git pull
# ÅÐÏ¿ºÑ¤ßÈëÌ©¸°¤Î³Îǧ¡£°ì¤Ä¤À¤±¤Ë¤·¤Æ¤ª¤¯¡£ ssh-add -l # github¥æ¡¼¥¶¤Î³Îǧ¡£¤³¤³¤Ç³ºÅö¥æ¡¼¥¶¤«¤ò³Îǧ ssh git@github.com git clone git@github.com:<USER>/example.git cd example/ git config --local user.name "acocunt B name" git config --local user.email "account B email"
/ssh/.config ¤Ç github.com¤ËÊÌ̾¤òÉÕ¤±¤ëÊýË¡
git clone git@github.com:<USER>/example.git cd example/ git config user.name "user1" git config user.email "user1@example.com" git config --list # sshÈëÌ©¸°¤òŬÅö¤Ê¾ì½ê¤ËÃÖ¤¯ vim ~/.ssh/github-user1_rsa chmod 600 ~/.ssh/github-user1_rsa # ssh config¤òÊѹ¹¤·¡¢Å¬Åö¤Ê¥Û¥¹¥È̾¤òÉÕ¤±¤ë vim ~/.ssh/config ---- Host github-user1 User git Port 22 HostName github.com IdentityFile ~/.ssh/github-user1_rsa TCPKeepAlive yes IdentitiesOnly yes ---- # Àܳ¥Æ¥¹¥È: ¾ÜºÙ¤òÃΤꤿ¤±¤ì¤Ð¡Ö-v¡×¤òÉÕ¤±¤ë ssh -T github-user1 Hi user1! ... # ¤Î¤è¤¦¤Ëgithub¤Îuser name¤¬É½¼¨¤µ¤ì¤ì¤ÐÀ®¸ù # ¥ê¥Ý¥¸¥È¥êÃæ¤Î¥¢¥É¥ì¥¹¤òÊѹ¹ vim .git/config ---- url = git@github-user1:REPO/git-test.git ----
git commit --amend --author="user1 <user1@example.com>" # ³Îǧ git log
ssh-keygen -t rsa -C "your_email@youremail.com" ÈëÌ©¸°¤È¸ø³«¸°¤¬½ÐÍè¤ë¤Î¤ÇÊݸ¤·¤Æ¤ª¤¯ ~/.ssh/id_rsa ~/.ssh/id_rsa.pub ¥³¥ß¥Ã¥È¥í¥°¤Ëɽ¼¨¤µ¤ì¤ë̾Á°¤È¥á¡¼¥ë¥¢¥É¥ì¥¹¤òÀßÄê¡£~/.gitconfig ¤ËÊݸ¤µ¤ì¤ë git config --global user.name "your_name" git config --global user.email "your_email@youremail.com"
mkdir example cd example git init touch README git add README git commit -m 'first commit' # URL¤Ë'origin' ¤È¤¤¤¦Ã»¤¤ÊÌ̾¤òÉÕ¤±¤ë(ɬ¿Ü¤Ç¤Ï¤Ê¤¤) git remote add origin git@github.com:your_name/example.git # git push git@github.com:your_name/example.git master:master ¤ÈƱ¤¸ git push -u origin master
git clone git://github.com/your_name/example.git cd example # ¥ê¥â¡¼¥È¤Î¹¹¿·ÆâÍƤòÈ¿±Ç git pull # ¥Õ¥¡¥¤¥ë¤ÎÄɲà git add README # Á´¤Æ¤ÎÊѹ¹¤òÄɲà git add . # Êѹ¹¤Î³Îǧ git status # º¹Ê¬¤Î³Îǧ git diff [¥Õ¥¡¥¤¥ë̾] # Êѹ¹¤ò¸µ¤ËÌ᤹ git revert ¥Õ¥¡¥¤¥ë̾ # Êѹ¹¤Î¥³¥ß¥Ã¥È git commit -a # ¥ê¥â¡¼¥È¥ê¥Ý¥¸¥È¥ê¤ØÈ¿±Ç git push