9

Version control: from zip to git

 2 years ago
source link: https://www.codesd.com/item/version-control-from-zip-to-git.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Version control: from zip to git

advertisements

I have three zipped folders named [1,2,3] each contains the same project 1 being the earliest and 3 being the most current. I am looking for a way to merge all of these into 3 git commits and the 3 most commit be the folders contents.

I suppose I can do the following:

  1. Unzip 1.
  2. Take the contents from 1 place it into a new folder.
  3. git init
  4. git add -A
  5. git commit -m "first commit
  6. Unzip 2
  7. replace the contents from the new folder with contents from 2
  8. git add -A
  9. git commit -m "second commit
  10. Unzip 2
  11. replace the contents from the new folder with contents from 3
  12. git add -A
  13. git commit -m "third commit

Could anyone tell me if this is the best way to do this?


Each time you run git init, you're creating an empty repository.

If there are only three folders and you're only doing it once, then this will work (if you omit git init). Just make sure not to erase the .git folder.

You could even unzip the three folders and move the .git folder to each in succession and commit in each separate folder, with the final folder being the start of your new repository.


Recommend

  • 40
    • snyk.io 6 years ago
    • Cache

    Zip Slip Vulnerability | Snyk

    Zip Slip is a widespread arbitrary file overwrite critical vulnerability, which typically results in remote command execution. It was discovered and responsibly disclosed by the Snyk Security team, and affects thousands of projects.

  • 71
    • www.linuxprobe.com 5 years ago
    • Cache

    Linux下zip的操作命令

    1.zip -r myfile.zip ./* 将当前目录下的所有文件和文件夹全部压缩成myfile.zip内联代码块文件,内联代码块-r表示递归压缩子目录下所有文件。 2.unzip unzip -o -d...

  • 30
    • www.tuicool.com 4 years ago
    • Cache

    A better zip bomb

    Summary This article shows how to construct a non-recursive zip bomb that achieves a high compression ratio by overlapping files inside the zip con...

  • 25
    • www.cnblogs.com 4 years ago
    • Cache

    zip矩阵转至

    1 list01=[1,2,3,4] 2 list02=["a","b","c","d"] 3 4 for itme in zip(list01,list02): 5 print(list(itme)) 结果: [1, 'a'] [2, 'b'] [3, 'c'] [4, 'd'] zip最简单的...

  • 8

    Understanding Version Control with Git (Cisco DevNet) May 25, 2020 By Rowell Le...

  • 7
    • www.patricksoftwareblog.com 3 years ago
    • Cache

    Version Control using Git and GitLab

    Introduction Now that we have a basic Flask application written, this project should be put under version control.  Git is the de facto tool for version contro...

  • 3

    Missing Semester Notes - Version Control (git)2020-05-22版本控制系统就是用来追踪文件或文件夹改变的工具。一方面可以用来维护文件修改的历史,另一方面它促进了多人协作。版本控制这么有用是为啥呢?就算你一个人工作,你也可以通过...

  • 9

    This article was originally published on blog.escape.tech.

  • 4

  • 4
    • developers.redhat.com 10 months ago
    • Cache

    A beginner's guide to Git version control

    Git is a widely used distributed version control system that allows software development teams to have multiple local copies of the project's source code that are independent of each other. Version control has come to be associated with Git—it is...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK