Create your own repository in the right place!
What is a repository? Repository also known as the Warehouse, English name repository, you can simply understand a directory, the directory of all the files can be managed by git, each file modification, deletion, git can track, So that you can track history at any time, or you can "restore" at some point in the future.
The first step: creating a repository is very simple, first of all, choosing a suitable place to create an empty directory:
Step Two: use the git init command to turn this directory into a repository that git can manage
Instant Git has built the warehouse and tells you it's an empty repository (empty Git repository), and the attentive reader can find a. git directory in the current directory , which is git to track the repository. Do not manually modify the files in this directory, or change the mess, the Git repository to destroy.
If you don't see . Git directory, because this directory is hidden by default and can be seen with the Ls-ah command.
Create a new hello.txt text in workspace
then put the text add to git 's management
The Git status command lists all files in the current directory that have not yet been managed by git, and files that have been managed by git and have been modified but not yet committed (git commit).
Tell git we submitted the file
configuration before running Git for the first time
generally in the new system, we need to first configure their own Git work environment. The configuration works only once, and the current configuration is used later in the upgrade. Of course, you can always modify an existing configuration with the same command if you want.
User Information
The first one to configure is your personal user name and email address. These two configurations are important, and each time Git commits, it references these two messages, stating who submitted the update, so it will be permanently included in the history along with the update:
because the above clone is the use of the HTTPS protocol, so each time the submission will be prompted to enter the user name and password!
Press i o a to enter edit status
in Edit : Switch to Bottom Line mode! after :wq! Save and Exit!
Re Start Git Bash !
If the first clone fails is because Not configuring sshkey! on your own git
Continue with the following actions
open file, copy content
There will be one more under the folder
If you are publishing a local repository to git , you will encounter the following problem
Executing the following code will resolve the issue
MyEclipse Installing the egit plugin
Open Create a git folder
Unzip the downloaded egit compressed file into the git folder!
then restart MyEclipse
Solutions
go back to the previous step Select Force Update
Small tofu @admin mingw64/e/workgit
$ git init
Initialized empty Git repository in e:/workgit/.git/
Small Tofu @admin mingw64/e/workgit (Master)
$ pwd
/e/workgit
Small Tofu @admin mingw64/e/workgit (Master)
$ ls
Small Tofu @admin mingw64/e/workgit (Master)
$ ls-a
./ .. /. git/
Small Tofu @admin mingw64/e/workgit (Master)
$ ls
Hello.txt
Small Tofu @admin mingw64/e/workgit (Master)
$ gid Add Hello.txt
Bash:gid:command not found
Small Tofu @admin mingw64/e/workgit (Master)
$ git Add hello.txt
Small Tofu @admin mingw64/e/workgit (Master)
$ git status
On Branch Master
Initial Commit
Changes to be committed:
(use "Git rm--cached <file> ..." to Unstage)
New File:hello.txt
Small Tofu @admin mingw64/e/workgit (Master)
$ git commit-m "I just submitted a hello.txt file";
Please tell me who is you.
Run
git config--global user.email "[Email protected]"
git config--global user.name "Your name"
To set your account ' s default identity.
Omit--global to set the identity of the This repository.
Fatal:empty ident name (for <с[email protected] (none) >) not allowed
Small Tofu @admin mingw64/e/workgit (Master)
$ git config--global user.email "[Email protected]"
Small Tofu @admin mingw64/e/workgit (Master)
$ git config--global user.name "Xiaodoufu"
Small Tofu @admin mingw64/e/workgit (Master)
$ git commit-m "I just submitted a hello.txt file";
[Master (root-commit) 623dd73] I just submitted a hello.txt file.
1 file changed, 1 insertion (+)
Create mode 100644 Hello.txt
Small Tofu @admin mingw64/e/workgit (Master)
$ git config--list
Core.symlinks=false
Core.autocrlf=true
Core.fscache=true
Color.diff=auto
Color.status=auto
Color.branch=auto
Color.interactive=true
Help.format=html
Http.sslcainfo=e:/mygit/mingw64/ssl/certs/ca-bundle.crt
Diff.astextplain.textconv=astextplain
Rebase.autosquash=true
[Email protected]
User.name=xiaodoufu
Core.repositoryformatversion=0
Core.filemode=false
Core.bare=false
Core.logallrefupdates=true
Core.symlinks=false
Core.ignorecase=true
Core.hidedotfiles=dotgitonly
Small Tofu @admin mingw64/e/workgit (Master)
$ git clone https://git.oschina.net/jpwy999/test.git
Cloning into ' test ' ...
Remote:counting Objects:3, done.
Remote:total 3 (Delta 0), reused 0 (Delta 0)
Unpacking objects:100% (3/3), done.
Checking connectivity ... done.
Small Tofu @admin mingw64/e/workgit (Master)
$ CD Test
Small Tofu @admin mingw64/e/workgit/test (Master)
$ git Add hello.txt
Small Tofu @admin mingw64/e/workgit/test (Master)
$ git commit-m "first upload from my local"
[Master 8727f9e] from my local upload for the first time
1 file changed, 1 insertion (+)
Create mode 100644 Hello.txt
Small Tofu @admin mingw64/e/workgit/test (Master)
$ git Pull--rebase Origin master
From Https://git.oschina.net/jpwy999/test
* Branch Master--Fetch_head
Current Branch Master was up to date.
Small Tofu @admin mingw64/e/workgit/test (Master)
$ ssh-keygen-t rsa-c "[Email protected]"
Too many arguments.
Usage:ssh-keygen [-Q] [-B bits] [-t DSA | ecdsa | ed25519 | rsa | RSA1]
[-N New_passphrase] [-C Comment] [-F Output_keyfile]
ssh-keygen-p [-P old_passphrase] [-N new_passphrase] [-F keyfile]
ssh-keygen-i [-M Key_format] [-F Input_keyfile]
ssh-keygen-e [-M Key_format] [-F Input_keyfile]
Ssh-keygen-y [-F Input_keyfile]
ssh-keygen-c [-P passphrase] [-c comment] [-f keyfile]
Ssh-keygen-l [-v] [-e Fingerprint_hash] [-F Input_keyfile]
Ssh-keygen-b [-F Input_keyfile]
Ssh-keygen-d PKCS11
ssh-keygen-f hostname [-f known_hosts_file] [-l]
Ssh-keygen-h [-F Known_hosts_file]
ssh-keygen-r hostname [-f Known_hosts_file]
ssh-keygen-r hostname [-f input_keyfile] [-g]
Ssh-keygen-g Output_file [-v] [-B bits] [-M memory] [-s start_point]
Ssh-keygen-t output_file-f Input_file [-v] [-a rounds] [-j Num_lines]
[-j Start_line] [-K CHECKPT] [-W Generator]
Ssh-keygen-s ca_key-i certificate_identity [-h] [-N principals]
[-o option] [-V Validity_interval] [-Z serial_number] File ...
Ssh-keygen-l [-F Input_keyfile]
Ssh-keygen-a
Ssh-keygen-k-F Krl_file [-u] [-S ca_public] [-Z version_number]
File ...
Ssh-keygen-q-F krl_file File ...
Small Tofu @admin mingw64/e/workgit/test (Master)
$ ssh-keygen-t rsa-c "[Email protected]"
Generating public/private RSA key pair.
Enter file in which to save the key (/c/users/small tofu/.ssh/id_rsa):
Created directory '/c/users/small tofu/.ssh '.
Enter passphrase (empty for no passphrase):
Enter same Passphrase again:
Your identification has been saved in/c/users/small tofu/.ssh/id_rsa.
Your public key has been saved in/c/users/small tofu/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:YS8OGLTLMT6EA8H9K5C8MVQXDOU57OI+EYVVJIFKKHG [email protected]
The key ' s Randomart image is:
+---[RSA 2048]----+
| .. +o.oo. |
|. E.... |
| . . |
| . o |
| oo+ +. S |
|.. =OO.O. |
| o=+ Xoo |
|. +++=.*+ |
|. +ob.+=oo |
+----[SHA256]-----+
Small Tofu @admin mingw64/e/workgit/test (Master)
$ git Pull--rebase Origin master
From Https://git.oschina.net/jpwy999/test
* Branch Master--Fetch_head
Current Branch Master was up to date.
Small Tofu @admin mingw64/e/workgit/test (Master)
$ GIT push origin master
Fatal:authentication failed for ' https://git.oschina.net/jpwy999/test.git/'
Small Tofu @admin mingw64/e/workgit/test (Master)
$ GIT push origin master
Counting Objects:3, done.
Delta compression using up to 4 threads.
Compressing objects:100% (2/2), done.
Writing objects:100% (3/3), 323 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (Delta 0)
To Https://git.oschina.net/jpwy999/test.git
4f99553. 8727f9e Master, Master
Small Tofu @admin mingw64/e/workgit/test (Master)
$ git Add hello.txt
Small Tofu @admin mingw64/e/workgit/test (Master)
$ git commit-m "I upload I like"
[Master a1d6641] I upload I like
1 file changed, 1 insertion (+), 1 deletion (-)
Small Tofu @admin mingw64/e/workgit/test (Master)
$ GIT push origin master
Counting Objects:3, done.
Delta compression using up to 4 threads.
Compressing objects:100% (2/2), done.
Writing objects:100% (3/3), 313 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (Delta 0)
To Https://git.oschina.net/jpwy999/test.git
8727f9e. a1d6641 Master, Master
Small Tofu @admin mingw64/e/workgit/test (Master)
$
How to use Git (Code cloud) on MyEclipse