【Git】在VSCode中使用Git

 1 Windows PowerShell
 2 版权所有 (C) Microsoft Corporation。保留所有权利。
 3 
 4 尝试新的跨平台 PowerShell https://aka.ms/pscore6
 5 
 6 #初始化Git环境,生成隐藏的.git文件夹及其中的数据
 7     PS C:\Users\ICanShine\Desktop\WorkSpace> git init
 8     Initialized empty Git repository in C:/Users/ICanShine/Desktop/WorkSpace/.git/
 9 
10 #此时,更改config文件。写入 远程仓库名称 和 仓库链接。
11     PS C:\Users\ICanShine\Desktop\WorkSpace> git remote add GitStudy https://gitee.com/ICanShine/git-study.git
12 
13 #此时,更改config文件。写入 远程仓库名称 和 托管平台密码,以实现永久的免密连接。
14     [core]
15         repositoryformatversion = 0
16         filemode = false
17         bare = false
18         logallrefupdates = true
19         ignorecase = true
20     [remote "GitStudy"]
21         url = https://ICanShine:托管平台密码@gitee.com/ICanShine/git-study.git
22         fetch = +refs/heads/*:refs/remotes/GitStudy/*
23 
24 #将远程仓库拉入本地工作区
25     PS C:\Users\ICanShine\Desktop\WorkSpace> git pull GitStudy master     ://gitee.com/ICanShine/g
26     remote: Enumerating objects: 6, done.
27     remote: Counting objects: 100% (6/6), done.
28     remote: Compressing objects: 100% (6/6), done.
29     Unpacking objects: 100% (6/6), 13.32 KiB | 231.00 KiB/s, done.        
30     From https://gitee.com/ICanShine/git-study
31      * branch            master     -> FETCH_HEAD
32      * [new branch]      master     -> GitStudy/master
33  
34 #此时就是编辑项目的时刻了。
35 ###进行一些列更改以后###
36 
37 #将工作区的内容添加到暂存区
38     PS C:\Users\ICanShine\Desktop\WorkSpace> git add .
39 
40 #将暂存区的内容送入本地仓库
41     PS C:\Users\ICanShine\Desktop\WorkSpace> git commit -m "版本更新"     
42     [master b0e0138] 版本更新
43      1 file changed, 11 insertions(+)
44      create mode 100644 "\346\226\260\345\273\272\346\226\207\344\273\266.html"
45  
46 #将本地仓库的内容推入远程仓库
47     PS C:\Users\ICanShine\Desktop\WorkSpace> git push GitStudy master     
48     Enumerating objects: 4, done.
49     Counting objects: 100% (4/4), done.
50     Delta compression using up to 8 threads
51     Compressing objects: 100% (3/3), done.
52     Writing objects: 100% (3/3), 457 bytes | 228.00 KiB/s, done.
53     Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
54     remote: Powered by GITEE.COM [GNK-5.0]
55     To https://gitee.com/ICanShine/git-study.git
56        f3ff58e..b0e0138  master -> master
57     PS C:\Users\ICanShine\Desktop\WorkSpace> 

 

posted @ 2020-11-09 22:10  BearKuma1069  阅读(129)  评论(0)    收藏  举报