English 中文(简体)
保存历史档案
原标题:git keep files from history others removed
  • 时间:2012-05-13 09:46:09
  •  标签:
  • git
问题回答

您是否肯定你为什么要建立一个全新的存放处,而只是从这两个档案中整理出来?

$ mkdir my_repo
$ cd my_repo/
$ git init
Initialized empty Git repository in /Users/annelicuss/my_repo/.git/
$ wget https://raw.github.com/visionmedia/express/master/lib/request.js
--2012-05-13 20:38:08--  https://raw.github.com/visionmedia/express/master/lib/request.js
Resolving raw.github.com... 207.97.227.243
Connecting to raw.github.com|207.97.227.243|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8878 (8.7K) [text/plain]
Saving to: `request.js 

100%[======================================>] 8,878       --.-K/s   in 0s      

2012-05-13 20:38:10 (242 MB/s) - `request.js  saved [8878/8878]

$ wget https://raw.github.com/visionmedia/express/master/lib/response.js
--2012-05-13 20:38:16--  https://raw.github.com/visionmedia/express/master/lib/response.js
Resolving raw.github.com... 207.97.227.243
Connecting to raw.github.com|207.97.227.243|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15276 (15K) [text/plain]
Saving to: `response.js 

100%[=======================================================================================================>] 15,276      --.-K/s   in 0s      

2012-05-13 20:38:17 (280 MB/s) - `response.js  saved [15276/15276]

$ ls
request.js  response.js
$ git add *
$ git commit -m  Add request, response from Express. 
[master (root-commit) be4a6d9] Add request, response from Express.
 2 files changed, 1059 insertions(+), 0 deletions(-)
 create mode 100644 request.js
 create mode 100644 response.js
$ git log
commit be4a6d9c82cb48b61f662e1e83a9f696a6685883
Author: Arlen Cuss <[email protected]>
Date:   Sun May 13 20:38:37 2012 +1000

    Add request, response from Express.
$ 

请注意,即使这或许会赢得你的希望;request.jsresponse.js取决于,例如util.js载于同一名录。 你可能只想加上对你的项目的依赖。





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签