1. Create a new Code warehouse
2. Generate key
Ssh-keygen-c ' [email protected]ail.address '-t RSA
3. Locate the Id_rsa.pub file under the. ssh folder in the root directory, and copy the contents to the target location.
4. Enter ssh-t [email protected] under git shell to test if the public key you just uploaded is correct
When it is correct, it displays:
Hi "Your Name"! You've successfully authenticated, but GitHub does not provide shell access.
5. Assign the address of the code warehouse you just created, clone the contents of the repository to a local
git clone https://github.com/YangXudongJack/JYMenuview.git
6. Then clone the code locally, then locate the repository file and copy the code file you want to submit.
7. Cut into the Git shell and enter the command
Git init
Git commit-m ' Jymenuview '
Git remote add Origin https://github.com/YangXudongJack/JYMenuview.git
Git push Origin Master
(1) If you execute git commit-m ' jymenuview ' error message
On Branch Master
Your branch is up-to-date with ' origin/master '.
untracked files:
jymenuview.xcodeproj/
jymenuview/
jymenuviewtests/
jymenuviewuitests/
Nothing added to commits but untracked files present
Then execute git add jymenuview.xcodeproj/and add the prompt files to the repository's management directory.
(2) If you execute GIT remote add origin
Https://github.com/Flowerowl/stumansys.git
, an error occurred:
Fatal:remote origin already exists
The following statement is executed:
Git remote RM origin
Then execute git remote add origin https://github.com/Flowerowl/stumansys.git .
(3) When executing GIT push Origin master, error:
error:failed to-push som refs to ....
The following statement is executed:
Git pull Origin Master
First pull down the file on github above the remote server and push it up.
The first time you've encountered a problem submitting your code with GitHub desktop (MAC)