Use git for intragroup collaboration

Stream saver: Successful operation:

insert image description here

Bug fix method:

HP@VICTUS MINGW64 /f/PRP/RMMDet_manual (main)
$ ssh -T [email protected]
kex_exchange_identification: Connection closed by remote host
Connection closed by 20.205.243.166 port 22

HP@VICTUS MINGW64 /f/PRP/RMMDet_manual (main)
$ ssh -T [email protected]
Hi JameLanny! You've successfully authenticated, but GitHub does not provide shell access.

Sometimes logging in on the webpage and opening the warehouse will succeed

I was a little surprised at the beginning
insert image description here
insert image description here
, since it’s a good thing, let’s use it

Please add a picture description

$ git clone https://github.com/********/Pre.git

insert image description here

Very fast, cloning to the local is still easy to operate

Realize the function of remote submission

The HTTPS protocol is used to clone the warehouse, and there is no need to configure an SSH key. The HTTPS protocol requires each user name and password to be entered for code operations.

But if you use the SSH protocol to clone the warehouse, you need to configure the SSH key to perform code operations. The steps to configure the SSH key are as follows:

  1. Open a terminal (MacOS/Linux) or a command prompt (Windows), and enter the following command:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
  1. Follow the prompts and press Enter all the way to generate an SSH key. The generated SSH key is saved in .ssha folder under the user directory by default.

  2. Open the generated public key file (by default id_rsa.pub), and copy the public key content to the SSH keys of the github account.

  3. To test whether the SSH key is configured successfully, enter the following command:

ssh -T [email protected]

If prompted Hi username! You've successfully authenticated, but GitHub does not provide shell access., the configuration is successful.

After the configuration is complete, the warehouse can be cloned using the SSH protocol, and there is no need to enter the user name and password every time.
insert image description here

HP@VICTUS MINGW64 /e/Users/HP/Desktop/Pre (main)
$ git add .

HP@VICTUS MINGW64 /e/Users/HP/Desktop/Pre (main)
$ git commit -m "add to files 4.17 evening"
[main c990bec] add to files 4.17 evening
 2 files changed, 46 insertions(+)
 create mode 100644 MC2_BGM.md
 create mode 100644 MC3_THEME.md

HP@VICTUS MINGW64 /e/Users/HP/Desktop/Pre (main)
$ git push origin master
error: src refspec master does not match any
error: failed to push some refs to 'github.com:zzjc1234/Pre.git'

HP@VICTUS MINGW64 /e/Users/HP/Desktop/Pre (main)
$ git branch
* main

HP@VICTUS MINGW64 /e/Users/HP/Desktop/Pre (main)
$ git checkout -b master
Switched to a new branch 'master'

HP@VICTUS MINGW64 /e/Users/HP/Desktop/Pre (master)
$ git push origin master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 16 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1.77 KiB | 1.77 MiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: Create a pull request for 'master' on GitHub by visiting:
remote:      https://github.com/zzjc1234/Pre/pull/new/master
remote:
To github.com:zzjc1234/Pre.git
 * [new branch]      master -> master

At this time, the submission was successful
insert image description here

おすすめ

転載: blog.csdn.net/m0_73293161/article/details/130189246