简体   繁体   中英

How do I add and push a file into a clone repository in VS

Bear with me as I'm still trying to figure out how to use Git.

I have connect my GitHub to my VSCode and cloned my repository into my VS workspace.

I have copy and pasted a folder from my desktop into the cloned repository workspace, and I would like to know how I could push and commit the folder into my main repository?

The folder size was too big to be uploaded into the GitHub web and there is too much file within the folder to be uploaded individual via GitHub web.

Is there is any tutorial or guide on how I could do so?

I have manage to push my folder into my Github Repository, thanks to the proposed guide, but I am unable to open up the folder in the web.

在此处输入图片说明

From VSCode, you can:

  • open a terminal and git add yourFolder
  • do git status to see the list of all files added: some might not belong to a Git repository, as they are too big
  • do git reset yourfolder in order to remove it from the Git index
  • edit a .gitignore file (at the root folder of your cloned repository) in which you can add the files or file extensions that you do not want to add

For instance:

*.exe
*.zip
*.tar
*.tgz

Repeat the add and status: check the list of files considered by Git is more reasonable.

Then you can commit and push . Using the GitLens extension will add more Git features for you to use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM