克隆一个repo,只是为了获取它的内容,在另一个Git仓库的子目录中

时间:2017-07-21 08:37:50

标签: git laravel github

厌倦了每次我开始一个新的Laravel项目时创建相同的目录并创建相同的文件,对于前面的事情,我决定使用assetsviews文件夹创建一个Git仓库和里面的一些文件,只是为了让我的结构快速准备好。

This repo can be accessed here(关于这个问题没什么用处,这只是为了清楚我要做什么)

我的想法是在我的Laravel项目中拉出/获取/使用你想要的那个非常回复的术语(当然,这本身就是一个Git回购),就是这样。

非常清楚,步骤将是这样的:

  1. 开始新的回购my-new-project
  2. 部署新的Laravel安装程序(遵循官方说明)
  3. 进入resources目录
  4. 从我的前端骨架库中提取内容
  5. 开始工作,忘记现在与项目相关的前骨架存储库,不需要更新
  6. 我坚持认为我不是在谈论对Git仓库的进一步操作,我真的在谈论一劳永逸地获取内容,然后忘记了Git仓库的存在

    • 我听说子树子模块但这似乎对我的需求太多了;
    • 我没有找到正确使用远程的方法(我的前框架被拉了但是在我的Laravel项目的根部,而不是在我的resources子文件夹中)。

    这样做的最佳方法/最佳做法是什么?

1 个答案:

答案 0 :(得分:0)

这可以通过以下脚本来处理:

  1. 在存储库上发布import { Component, OnInit } from '@angular/core'; import {DataSource} from '@angular/cdk'; import {BehaviorSubject} from 'rxjs/BehaviorSubject'; import {Observable} from 'rxjs/Observable'; import 'rxjs/add/operator/startWith'; import 'rxjs/add/observable/merge'; import 'rxjs/add/operator/map'; @Component({ selector: 'app-admin-products', templateUrl: './admin-products.component.html', styleUrls: ['./admin-products.component.css'] }) export class AdminProductsComponent implements OnInit { curentPage: string; isDarkTheme: any; totalProducts: any = 88; totalNeeds: any = 88; totalBrands: any = 88; totalAgeGroups: any = 88; constructor() { this.curentPage = 'Products'; this.isDarkTheme = false; } ngOnInit() { } } /** Constants used to fill up our data base. */ const COLORS = ['maroon', 'red', 'orange', 'yellow', 'olive', 'green', 'purple', 'fuchsia', 'lime', 'teal', 'aqua', 'blue', 'navy', 'black', 'gray']; const NAMES = ['Maia', 'Asher', 'Olivia', 'Atticus', 'Amelia', 'Jack', 'Charlotte', 'Theodore', 'Isla', 'Oliver', 'Isabella', 'Jasper', 'Cora', 'Levi', 'Violet', 'Arthur', 'Mia', 'Thomas', 'Elizabeth']; export interface UserData { id: string; name: string; progress: string; color: string; } /** An example database that the data source uses to retrieve data for the table. */ export class ExampleDatabase { /** Stream that emits whenever the data has been modified. */ dataChange: BehaviorSubject<UserData[]> = new BehaviorSubject<UserData[]>([]); get data(): UserData[] { return this.dataChange.value; } constructor() { // Fill up the database with 100 users. for (let i = 0; i < 100; i++) { this.addUser(); } } /** Adds a new user to the database. */ addUser() { const copiedData = this.data.slice(); copiedData.push(this.createNewUser()); this.dataChange.next(copiedData); } /** Builds and returns a new User. */ private createNewUser() { const name = NAMES[Math.round(Math.random() * (NAMES.length - 1))] + ' ' + NAMES[Math.round(Math.random() * (NAMES.length - 1))].charAt(0) + '.'; return { id: (this.data.length + 1).toString(), name: name, progress: Math.round(Math.random() * 100).toString(), color: COLORS[Math.round(Math.random() * (COLORS.length - 1))] }; } } /** * Data source to provide what data should be rendered in the table. Note that the data source * can retrieve its data in any way. In this case, the data source is provided a reference * to a common data base, ExampleDatabase. It is not the data source's responsibility to manage * the underlying data. Instead, it only needs to take the data and send the table exactly what * should be rendered. */ export class ExampleDataSource extends DataSource<any> { constructor(private _exampleDatabase: ExampleDatabase) { super(); } /** Connect function called by the table to retrieve one stream containing the data to render. */ connect(): Observable<UserData[]> { return this._exampleDatabase.dataChange; } disconnect() {} } ,然后

  2. 删除新创建的for i in json_data[0]: print (i['name']) 目录中的git clone --depth=1 <url> <destination>文件夹

  3. 因此,您可以从git repo中获取所有内容,而且全部都是。

相关问题