简体   繁体   English

版本控制和git checkout / clone

[英]Version control and git checkout/clone

I am using Bootstrap SASS. 我正在使用Bootstrap SASS。 I learning git slowly. 我慢慢学习git。 I want to be able to update files located in folders from this repo on git when they are updated, however I don't want to clone the entire repo, as I use a different file structure. 我希望能够在更新时从git上此仓库中的文件夹中更新文件,但是我不想克隆整个仓库,因为我使用了不同的文件结构。 As an example: 举个例子:

Bootstrap SASS holds the js files here: Bootstrap SASS在此处保存js文件:

https://github.com/twbs/bootstrap-sass/tree/master/vendor/assets/javascripts/bootstrap

My local js files are here: 我的本地js文件在这里:

app/assets/javascripts/scripts

In my local directory I have additional scripts which I concat in with bootstrap .js files. 在我的本地目录中,我还有其他脚本,它们与bootstrap .js文件结合在一起。 My question is, How would I clone/update the files in a folder from the bootstrap SASS repo to the local repo without having conflict with the addition scripts inside my local repo and not having to clone the entire repo, just the files or better yet particular files. 我的问题是,如何将文件夹中的文件从引导SASS存储库克隆/更新到本地存储库,而又不与本地存储库中的添加脚本冲突,而不必克隆整个存储库,只需复制文件或更好的文件特定文件。

Considering you really aren't using the full bootstrap SASS repo but only specific files, it is best to version a script able to copy files from https://github.com/twbs/bootstrap-sass , using the raw address ( https://raw.githubusercontent.com ): 考虑到您确实不是在使用完整的Bootstrap SASS存储库,而是仅在特定文件上使用,所以最好使用原始地址( https:来对能够从https://github.com/twbs/bootstrap-sass复制文件的脚本进行版本控制。 //raw.githubusercontent.com ):

https://raw.githubusercontent.com/twbs/bootstrap-sass/master/vendor/assets/javascripts/bootstrap/carousel.js

If that scripts copies files that are modified since the last copy, a git status in your repo will detect it and will allow you to add, commit and push. 如果该脚本复制自上次复制以来已修改的文件,则您存储库中的git status将对其进行检测,并允许您添加,提交和推送。

If that script copies files that are unchanged since the last copy, the git status will report a clean repo. 如果该脚本复制自上次复制以来未更改的文件,则git status将报告一个干净的仓库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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