.
This commit is contained in:
50
Notes/git1.md
Normal file
50
Notes/git1.md
Normal file
@ -0,0 +1,50 @@
|
||||
~/.ssh/config
|
||||
|
||||
Host 10.168.0.129
|
||||
|
||||
Hostname 10.168.0.129
|
||||
|
||||
IdentityFile ~/.mykeys/gitkey
|
||||
|
||||
|
||||
-------------
|
||||
|
||||
git config http.sslVerify false
|
||||
|
||||
-----------
|
||||
|
||||
GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example" git clone xxxxxx
|
||||
|
||||
----------------
|
||||
|
||||
git config core.sshCommand "ssh -i ~/.mykeys/gitkey -F /dev/null"
|
||||
|
||||
-------
|
||||
|
||||
git config --global user.email "cccccc"
|
||||
|
||||
git config --global user.name "cccccc"
|
||||
|
||||
--------
|
||||
https://stackoverflow.com/questions/4565700/how-to-specify-the-private-ssh-key-to-use-when-executing-shell-command-on-git
|
||||
|
||||
|
||||
---------------
|
||||
|
||||
git config
|
||||
|
||||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = false
|
||||
logallrefupdates = true
|
||||
sshCommand = ssh -i ~/.ssh/KEYS -F /dev/null
|
||||
[remote "origin"]
|
||||
url = ssh://git@DOMAIN:SSH_PORT/GIT_USER/GIT_REPO.git
|
||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||
url = git@github.com:GIT_USER/GIT_REPO.git
|
||||
[pull]
|
||||
rebase = false
|
||||
[branch "main"]
|
||||
remote = origin
|
||||
merge = refs/heads/main
|
||||
55
Notes/git2.md
Normal file
55
Notes/git2.md
Normal file
@ -0,0 +1,55 @@
|
||||
|
||||
|
||||
|
||||
USER1=
|
||||
|
||||
USER2=
|
||||
|
||||
PRIVATEIP=
|
||||
|
||||
REPO=
|
||||
|
||||
git init
|
||||
|
||||
git config --global init.defaultBranch main
|
||||
|
||||
touch README.md
|
||||
|
||||
git add README.md
|
||||
|
||||
git commit -m "first commit"
|
||||
|
||||
git remote add origin http://${PRIVATEIP}/git/${USER1}/${REPO}.git
|
||||
|
||||
git remote set-url origin ssh://git@${PRIVATEIP}:3022/${USER1}/${REPO}.git
|
||||
|
||||
git remote set-url --add origin git@github.com:${USER2}/${REPO}.git
|
||||
|
||||
git branch -M main
|
||||
|
||||
git push -u origin main
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
---- email setup git config --global user.email "USER@DOMAIN.com"
|
||||
|
||||
git config --global user.name "USER"
|
||||
|
||||
---- use thru tunnel git config --global http.sslverify false
|
||||
|
||||
PORT=xxxx REMOTE=user@domain
|
||||
|
||||
ssh ${REMOTE} -p ${PORT} -D 9999 -N
|
||||
|
||||
git config --global http.sslverify false
|
||||
|
||||
PRIVATEIP=bbbb
|
||||
|
||||
git -c http.proxy=socks5://localhost:9999 clone http://${PRIVATEIP}/git/${USER1}/tester.git
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user