其他分享
首页 > 其他分享> > git管理仓库的一个完整流程

git管理仓库的一个完整流程

作者:互联网


蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop
$ git config --global user.name 'Link'

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop
$ git config --global user.email '1183234982@qq.com'

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop
$ mkdir my_repository

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop
$ cd my_repository

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository
$ git init
Initialized empty Git repository in C:/Users/ASUS/Desktop/my_repository/.git/

$ touch my_file.html

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository (master)
$ vi my_file.html

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository (master)
$ cat my_file.html
新建文件的内容,完成后Esc退回vi命令行,输入:wq或:x保存内容,:x则不保存内容。

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository (master)
$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        my_file.html

nothing added to commit but untracked files present (use "git add" to track)

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository (master)
$ git add my_file.html
warning: LF will be replaced by CRLF in my_file.html.
The file will have its original line endings in your working directory

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository (master)
$ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
        new file:   my_file.html


蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository (master)
$ git commit -m '新建的文件my_file.html'
[master (root-commit) f7e10ad] 新建的文件my_file.html
 1 file changed, 1 insertion(+)
 create mode 100644 my_file.html

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository (master)
$ git status
On branch master
nothing to commit, working tree clean

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository (master)
$ git config --list
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=D:/GIT/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
pull.rebase=false
credential.helper=manager-core
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
user.name=Link
user.email=1183234982@qq.com
core.editor="E:\Visual Studio Code\Microsoft VS Code\Code.exe" --wait
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository (master)
$ git clone https://github.com/wuying-05/my_repository.git
Cloning into 'my_repository'...
remote: Enumerating objects: 3, done.
Receiving objects: 100% (3/3), done.bjects: 100% (3/3)  33% (1/3)
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository (master)
$ cd my_repository

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository/my_repository (main)
$ git push
Everything up-to-date

蒲公英的夏天@LAPTOP-JHK6PS9J MINGW64 ~/Desktop/my_repository/my_repository (main)
$

@沉木

标签:git,repository,仓库,流程,Desktop,JHK6PS9J,my,LAPTOP
来源: https://blog.csdn.net/Java_53/article/details/112123051