最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】通过VSCode实现git代码的上传

Git crifan 2702浏览 0评论

之前已经修改了很多代码

然后此处是基于VSCode去编辑的。

然后此处,好像还有些额外的之前拷贝过来的文件,没有及时加进来,需要手动去加进来:

➜  ucowsapp git:(master) ✗ git status
On branch master
Your branch is up-to-date with ‘origin/master’.
Changes to be committed:
  (use "git reset HEAD <file>…" to unstage)
    new file:   src/assets/to_right_i.png
    new file:   src/container/abnormal-management/index.js
    new file:   src/container/abnormal-management/style.less
    new file:   src/container/breeding-management/index.js
    new file:   src/container/breeding-management/style.less
    new file:   src/container/breeding-process/index.js
    new file:   src/container/breeding-process/style.less
    new file:   src/container/cowshed-management/index.js
    new file:   src/container/cowshed-management/style.less
    new file:   src/container/pregnancy-management/index.js
    new file:   src/container/pregnancy-management/style.less
Changes not staged for commit:
  (use "git add/rm <file>…" to update what will be committed)
  (use "git checkout — <file>…" to discard changes in working directory)
    modified:   README.md
    modified:   package-lock.json
    modified:   package.json
    modified:   src/assets/lk_icon.png
    modified:   src/components/header/index.js
    modified:   src/components/header/style.less
    modified:   src/container/abnormal-management/index.js
    modified:   src/container/abnormal-management/style.less
    modified:   src/container/app.js
    modified:   src/container/breeding-management/index.js
    modified:   src/container/breeding-management/style.less
    modified:   src/container/breeding-process/index.js
    modified:   src/container/breeding-process/style.less
    modified:   src/container/cowshed-management/index.js
    modified:   src/container/cowshed-management/style.less
    deleted:    src/container/estrus-pend/index.js
    deleted:    src/container/estrus-pend/style.less
    modified:   src/container/main/index.js
    modified:   src/container/pregnancy-management/index.js
    modified:   src/container/pregnancy-management/style.less
    modified:   src/index.ejs
    modified:   src/store/store.js
    modified:   src/style/loading.less
    modified:   src/style/variables.less
    modified:   webpack.config.babel.js
Untracked files:
  (use "git add <file>…" to include in what will be committed)
    src/assets/ei_down.png
    src/assets/ei_up.png
    src/assets/lk_icon01.png
    src/assets/lk_icon02.png
    src/assets/lk_icon03.png
    src/assets/lk_icon04.png
    src/assets/seek_i.png
    src/components/base-modal/
    src/components/picker/
    src/components/popup/
    src/container/abnormal-process/
    src/container/breeding-add/
    src/container/cow-edit-add/
    src/container/cow-management/
    src/container/cowshed-edit-add/
    src/container/estrus-management/
    src/container/pregnancy-process/
➜  ucowsapp git:(master) ✗ git add src/assets/*.png
➜  ucowsapp git:(master) ✗ git status
On branch master
Your branch is up-to-date with ‘origin/master’.
Changes to be committed:
  (use "git reset HEAD <file>…" to unstage)
    new file:   src/assets/ei_down.png
    new file:   src/assets/ei_up.png
    modified:   src/assets/lk_icon.png
    new file:   src/assets/lk_icon01.png
    new file:   src/assets/lk_icon02.png
    new file:   src/assets/lk_icon03.png
    new file:   src/assets/lk_icon04.png
    new file:   src/assets/seek_i.png
    new file:   src/assets/to_right_i.png
    new file:   src/container/abnormal-management/index.js
    new file:   src/container/abnormal-management/style.less
    new file:   src/container/breeding-management/index.js
    new file:   src/container/breeding-management/style.less
    new file:   src/container/breeding-process/index.js
    new file:   src/container/breeding-process/style.less
    new file:   src/container/cowshed-management/index.js
    new file:   src/container/cowshed-management/style.less
    new file:   src/container/pregnancy-management/index.js
    new file:   src/container/pregnancy-management/style.less
Changes not staged for commit:
  (use "git add/rm <file>…" to update what will be committed)
  (use "git checkout — <file>…" to discard changes in working directory)
    modified:   README.md
    modified:   package-lock.json
    modified:   package.json
    modified:   src/components/header/index.js
    modified:   src/components/header/style.less
    modified:   src/container/abnormal-management/index.js
    modified:   src/container/abnormal-management/style.less
    modified:   src/container/app.js
    modified:   src/container/breeding-management/index.js
    modified:   src/container/breeding-management/style.less
    modified:   src/container/breeding-process/index.js
    modified:   src/container/breeding-process/style.less
    modified:   src/container/cowshed-management/index.js
    modified:   src/container/cowshed-management/style.less
    deleted:    src/container/estrus-pend/index.js
    deleted:    src/container/estrus-pend/style.less
    modified:   src/container/main/index.js
    modified:   src/container/pregnancy-management/index.js
    modified:   src/container/pregnancy-management/style.less
    modified:   src/index.ejs
    modified:   src/store/store.js
    modified:   src/style/loading.less
    modified:   src/style/variables.less
    modified:   webpack.config.babel.js
Untracked files:
  (use "git add <file>…" to include in what will be committed)
    src/components/base-modal/
    src/components/picker/
    src/components/popup/
    src/container/abnormal-process/
    src/container/breeding-add/
    src/container/cow-edit-add/
    src/container/cow-management/
    src/container/cowshed-edit-add/
    src/container/estrus-management/
    src/container/pregnancy-process/
➜  ucowsapp git:(master) ✗ git add src/container/*
➜  ucowsapp git:(master) ✗ git status
On branch master
Your branch is up-to-date with ‘origin/master’.
Changes to be committed:
  (use "git reset HEAD <file>…" to unstage)
    new file:   src/assets/ei_down.png
    new file:   src/assets/ei_up.png
    modified:   src/assets/lk_icon.png
    new file:   src/assets/lk_icon01.png
    new file:   src/assets/lk_icon02.png
    new file:   src/assets/lk_icon03.png
    new file:   src/assets/lk_icon04.png
    new file:   src/assets/seek_i.png
    new file:   src/assets/to_right_i.png
    new file:   src/container/abnormal-management/index.js
    new file:   src/container/abnormal-management/style.less
    new file:   src/container/abnormal-process/index.js
    new file:   src/container/abnormal-process/style.less
    modified:   src/container/app.js
    new file:   src/container/breeding-add/index.js
    new file:   src/container/breeding-add/style.less
    new file:   src/container/breeding-management/index.js
    new file:   src/container/breeding-management/style.less
    new file:   src/container/breeding-process/index.js
    new file:   src/container/breeding-process/style.less
    new file:   src/container/cow-edit-add/index.js
    new file:   src/container/cow-edit-add/style.less
    new file:   src/container/cow-management/index.js
    new file:   src/container/cow-management/style.less
    new file:   src/container/cowshed-edit-add/index.js
    new file:   src/container/cowshed-edit-add/style.less
    new file:   src/container/cowshed-management/index.js
    new file:   src/container/cowshed-management/style.less
    new file:   src/container/estrus-management/index.js
    new file:   src/container/estrus-management/style.less
    modified:   src/container/main/index.js
    new file:   src/container/pregnancy-management/index.js
    new file:   src/container/pregnancy-management/style.less
    new file:   src/container/pregnancy-process/index.js
    new file:   src/container/pregnancy-process/style.less
Changes not staged for commit:
  (use "git add/rm <file>…" to update what will be committed)
  (use "git checkout — <file>…" to discard changes in working directory)
    modified:   README.md
    modified:   package-lock.json
    modified:   package.json
    modified:   src/components/header/index.js
    modified:   src/components/header/style.less
    deleted:    src/container/estrus-pend/index.js
    deleted:    src/container/estrus-pend/style.less
    modified:   src/index.ejs
    modified:   src/store/store.js
    modified:   src/style/loading.less
    modified:   src/style/variables.less
    modified:   webpack.config.babel.js
Untracked files:
  (use "git add <file>…" to include in what will be committed)
    src/components/base-modal/
    src/components/picker/
    src/components/popup/
➜  ucowsapp git:(master) ✗ git add src/components/*
➜  ucowsapp git:(master) ✗ git status
On branch master
Your branch is up-to-date with ‘origin/master’.
Changes to be committed:
  (use "git reset HEAD <file>…" to unstage)
    new file:   src/assets/ei_down.png
    new file:   src/assets/ei_up.png
    modified:   src/assets/lk_icon.png
    new file:   src/assets/lk_icon01.png
    new file:   src/assets/lk_icon02.png
    new file:   src/assets/lk_icon03.png
    new file:   src/assets/lk_icon04.png
    new file:   src/assets/seek_i.png
    new file:   src/assets/to_right_i.png
    new file:   src/components/base-modal/index.js
    new file:   src/components/base-modal/style.less
    modified:   src/components/header/index.js
    modified:   src/components/header/style.less
    new file:   src/components/picker/index.js
    new file:   src/components/picker/style.less
    new file:   src/components/popup/index.js
    new file:   src/components/popup/style.less
    new file:   src/container/abnormal-management/index.js
    new file:   src/container/abnormal-management/style.less
    new file:   src/container/abnormal-process/index.js
    new file:   src/container/abnormal-process/style.less
    modified:   src/container/app.js
    new file:   src/container/breeding-add/index.js
    new file:   src/container/breeding-add/style.less
    new file:   src/container/breeding-management/index.js
    new file:   src/container/breeding-management/style.less
    new file:   src/container/breeding-process/index.js
    new file:   src/container/breeding-process/style.less
    new file:   src/container/cow-edit-add/index.js
    new file:   src/container/cow-edit-add/style.less
    new file:   src/container/cow-management/index.js
    new file:   src/container/cow-management/style.less
    new file:   src/container/cowshed-edit-add/index.js
    new file:   src/container/cowshed-edit-add/style.less
    new file:   src/container/cowshed-management/index.js
    new file:   src/container/cowshed-management/style.less
    new file:   src/container/estrus-management/index.js
    new file:   src/container/estrus-management/style.less
    modified:   src/container/main/index.js
    new file:   src/container/pregnancy-management/index.js
    new file:   src/container/pregnancy-management/style.less
    new file:   src/container/pregnancy-process/index.js
    new file:   src/container/pregnancy-process/style.less
Changes not staged for commit:
  (use "git add/rm <file>…" to update what will be committed)
  (use "git checkout — <file>…" to discard changes in working directory)
    modified:   README.md
    modified:   package-lock.json
    modified:   package.json
    deleted:    src/container/estrus-pend/index.js
    deleted:    src/container/estrus-pend/style.less
    modified:   src/index.ejs
    modified:   src/store/store.js
    modified:   src/style/loading.less
    modified:   src/style/variables.less
    modified:   webpack.config.babel.js

然后去VSCode中提交:

提交后,结果远端的服务器上,并没有提交到代码。

然后去看看本地的情况,结果石git commit到本地了,并没有push到远端:

➜  ucowsapp git:(master) ✗ git status
On branch master
Your branch is ahead of ‘origin/master’ by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working tree clean

然后再去git push

➜  ucowsapp git:(master) git push
Counting objects: 72, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (72/72), done.
Writing objects: 100% (72/72), 45.57 KiB | 0 bytes/s, done.
Total 72 (delta 33), reused 0 (delta 0)
To https://git.oschina.net/cowfarm/ucowsapp.git
   4b9e678..c68edb0  master -> master
➜  ucowsapp git:(master) git status
On branch master
Your branch is up-to-date with ‘origin/master’.
nothing to commit, working tree clean

就可以了,git仓库端就可以看到代码了:

转载请注明:在路上 » 【记录】通过VSCode实现git代码的上传

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.183 seconds, using 22.16MB memory