github从本地文件夹拉取建立一个repository
PS F:\New_py> git status
fatal: not a git repository (or any of the parent directories): .git
PS F:\New_py> echo "# hello" >> README.md
PS F:\New_py> git init
Initialized empty Git repository in F:/New_py/.git/
PS F:\New_py> git add README.md
PS F:\New_py> git commit -m "first commit"
[master (root-commit) 088af8b] first commit
1 file changed, 1 insertion(+)
create mode 100644 README.md
PS F:\New_py> git branch -M main
PS F:\New_py> git remote add origin https://github.com/Frankie32244/hello.git
PS F:\New_py> git push -u origin main
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 235 bytes | 235.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/Frankie32244/hello.git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'.
PS F:\New_py> git add .
warning: in the working copy of '.idea/inspectionProfiles/profiles_settings.xml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of '.vscode/tasks.json', LF will be replaced by CRLF the next time Git touches it
PS F:\New_py> git status
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: .idea/.gitignore
new file: .idea/New_py.iml
new file: .idea/inspectionProfiles/profiles_settings.xml
new file: .idea/misc.xml
new file: .idea/modules.xml
new file: .vscode/tasks.json
new file: Json_to_csv2.py
new file: __pycache__/fibo.cpython-310.pyc
new file: a.c
new file: a.exe
new file: a.py
new file: aa.txt
new file: connectMysql.py
new file: connect_Mysql.py
new file: demo.py
new file: fibo.py
new file: files/file1.txt
new file: files/file2.txt
new file: files/file3.txt
new file: files/folder1/hello.txt
new file: files/folder1/python.txt
new file: findString.py
new file: find_string.py
new file: getLinks.py
new file: input.json
new file: json_to_csv.py
new file: listFileNames.py
new file: list_filenames_in_dir.py
new file: output.csv
new file: output.txt
new file: requirements.txt
new file: sort_by_value.py
PS F:\New_py> git push -u origin main
Everything up-to-date
branch 'main' set up to track 'origin/main'.
PS F:\New_py> git branch -M main
PS F:\New_py> git remote add origin https://github.com/Frankie32244/hello.git
error: remote origin already exists.
PS F:\New_py> git push -u origin main
Everything up-to-date
branch 'main' set up to track 'origin/main'.
PS F:\New_py> git status
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: .idea/.gitignore
new file: .idea/New_py.iml
new file: .idea/inspectionProfiles/profiles_settings.xml
new file: .idea/misc.xml
new file: .idea/modules.xml
new file: .vscode/tasks.json
new file: Json_to_csv2.py
new file: __pycache__/fibo.cpython-310.pyc
new file: a.c
new file: a.exe
new file: a.py
new file: aa.txt
new file: connectMysql.py
new file: connect_Mysql.py
new file: demo.py
new file: fibo.py
new file: files/file1.txt
new file: files/file2.txt
new file: files/file3.txt
new file: files/folder1/hello.txt
new file: files/folder1/python.txt
new file: findString.py
new file: find_string.py
new file: getLinks.py
new file: input.json
new file: json_to_csv.py
new file: listFileNames.py
new file: list_filenames_in_dir.py
new file: output.csv
new file: output.txt
new file: requirements.txt
new file: sort_by_value.py
PS F:\New_py> git push origin main
Everything up-to-date
PS F:\New_py> git add --all
PS F:\New_py> git push origin main
Everything up-to-date
PS F:\New_py> git status
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: .idea/.gitignore
new file: .idea/New_py.iml
new file: .idea/inspectionProfiles/profiles_settings.xml
new file: .idea/misc.xml
new file: .idea/modules.xml
new file: .vscode/tasks.json
new file: Json_to_csv2.py
new file: __pycache__/fibo.cpython-310.pyc
new file: a.c
new file: a.exe
new file: a.py
new file: aa.txt
new file: connectMysql.py
new file: connect_Mysql.py
new file: demo.py
new file: fibo.py
new file: files/file1.txt
new file: files/file2.txt
new file: files/file3.txt
new file: files/folder1/hello.txt
new file: files/folder1/python.txt
new file: findString.py
new file: find_string.py
new file: getLinks.py
new file: input.json
new file: json_to_csv.py
new file: listFileNames.py
new file: list_filenames_in_dir.py
new file: output.csv
new file: output.txt
new file: requirements.txt
new file: sort_by_value.py
PS F:\New_py> git commit -m "initial commit"
[main b309731] initial commit
32 files changed, 472 insertions(+)
create mode 100644 .idea/.gitignore
create mode 100644 .idea/New_py.iml
create mode 100644 .idea/inspectionProfiles/profiles_settings.xml
create mode 100644 .idea/misc.xml
create mode 100644 .idea/modules.xml
create mode 100644 .vscode/tasks.json
create mode 100644 Json_to_csv2.py
create mode 100644 __pycache__/fibo.cpython-310.pyc
create mode 100644 a.c
create mode 100644 a.exe
create mode 100644 a.py
create mode 100644 aa.txt
create mode 100644 connectMysql.py
create mode 100644 connect_Mysql.py
create mode 100644 demo.py
create mode 100644 fibo.py
create mode 100644 files/file1.txt
create mode 100644 files/file2.txt
create mode 100644 files/file3.txt
create mode 100644 files/folder1/hello.txt
create mode 100644 files/folder1/python.txt
create mode 100644 findString.py
create mode 100644 find_string.py
create mode 100644 getLinks.py
create mode 100644 input.json
create mode 100644 json_to_csv.py
create mode 100644 listFileNames.py
create mode 100644 list_filenames_in_dir.py
create mode 100644 output.csv
create mode 100644 output.txt
create mode 100644 requirements.txt
create mode 100644 sort_by_value.py
PS F:\New_py> git push origin main
Enumerating objects: 41, done.
Counting objects: 100% (41/41), done.
Delta compression using up to 8 threads
Compressing objects: 100% (29/29), done.
Writing objects: 100% (40/40), 23.52 KiB | 2.35 MiB/s, done.
Total 40 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), done.
To https://github.com/Frankie32244/hello.git
088af8b..b309731 main -> main
PS F:\New_py>
github所给的操作
先按照指示来:
echo "# Object_detection" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/Frankie32244/Object_detection.git
git push -u origin main
然后
git add . # or git add --all
git status # check the status of git
git commit -m "initial commit"
git push origin main
在运行 git push origin main 这个命令的时候,可能会报错:
fatal: unable to access ‘https://github.com/tata20191003/autowrite.git/‘: Failed to connected
参考(https://blog.csdn.net/qq_37604802/article/details/116713861)
//取消http代理
git config --global --unset http.proxy
//取消https代理
git config --global --unset https.proxy
参考链接:
ref1