【GIT】【命令行】

时间:2022-12-21 11:29:04
  1. 进入某没有做git的目录: git init -》username@DESKTOP-765V31O MINGW64 ~/PycharmProjects/user_data (master)

  2. 新建文件a.txt

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/user_data (master)

$ git status

On branch master

No commits yet

Untracked files:

(use "git add ..." to include in what will be committed)

    a.txt

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/user_data (master)

$ git add *

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/user_data (master)

$ git status

On branch master

No commits yet

Changes to be committed:

(use "git rm --cached ..." to unstage)

    new file:   a.txt

4)

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/user_data (master)

$ git branch test

5)

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/user_data (master)

$ git checkout test

Switched to branch 'test'

6)

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/user_data (test)

$ git commit -m "test"

[test dead7b3] test

1 file changed, 0 insertions(+), 0 deletions(-)

7)

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/user_data (test)

$ git status

On branch test

nothing to commit, working tree clean

8)

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/user_data (test)

$ git checkout master

Switched to branch 'master'

9)

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/user_data (master)

$ git merge test

Updating 8d449c4..dead7b3

Fast-forward

a.txt | Bin 8192 -> 8192 bytes

1 file changed, 0 insertions(+), 0 deletions(-)

10)

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/user_data (master)

$ git status

On branch master

nothing to commit, working tree clean

11)

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects

$ mkdir bn

12)

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects

$ cd bn/

13)

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/bn

$ git clone git@github.com:/autotest.git

Cloning into 'autotest'...

The authenticity of host 'github.com (
.
..*)' can't be established.

RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.

Are you sure you want to continue connecting (yes/no)?

Host key verification failed.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

wangxue@DESKTOP-765V31O MINGW64 ~/PycharmProjects/bn

$ git clone https://surenyufu2019@github.com/**/autotest.git

Cloning into 'autotest'...

remote: Enumerating objects: 75, done.

remote: Counting objects: 100% (75/75), done.

remote: Compressing objects: 100% (48/48), done.

remote: Total 23037 (delta 37), reused 48 (delta 23), pack-reused 22962

Receiving objects: 100% (23037/23037), 39.11 MiB | 3.83 MiB/s, done.

Resolving deltas: 100% (14252/14252), done.

Checking out files: 100% (1370/1370), done.

接下来的可以在pycharm里操作