repository

can you host a private repository for your organization to use with npm?

≡放荡痞女 提交于 2019-11-26 03:03:43
问题 Npm sounds like a great platform to use within an organization, curious if a private repo is possible, like with Nexus/Maven. Nothing comes up on Google :( 回答1: I don't think there is an easy way to do this. A look at the npm documentation tells us, that it is possible: Can I run my own private registry? Yes! The easiest way is to replicate the couch database, and use the same (or similar) design doc to implement the APIs. If you set up continuous replication from the official CouchDB, and

Untrack files from git temporarily

若如初见. 提交于 2019-11-26 02:59:25
问题 I have setup a local git on my machine. When I initialized git, I added pre-compiled libs and binaries. However, now during my development I don\'t want to check in those files intermittently. I dont want to remove these files from repo. Is there any way to not keep a track of these files till I complete my development. (I think I can not use .gitignore as it works only for those files which are not in git. I want to temporarily disable tracking of files.) 回答1: git update-index should do what

How to count total lines changed by a specific author in a Git repository?

柔情痞子 提交于 2019-11-26 02:39:25
问题 Is there a command I can invoke which will count the lines changed by a specific author in a Git repository? I know that there must be ways to count the number of commits as Github does this for their Impact graph. 回答1: The output of the following command should be reasonably easy to send to script to add up the totals: git log --author="<authorname>" --oneline --shortstat This gives stats for all commits on the current HEAD. If you want to add up stats in other branches you will have to

What&#39;s the -practical- difference between a Bare and non-Bare repository?

こ雲淡風輕ζ 提交于 2019-11-26 01:37:15
问题 I\'ve been reading about the bare and non-bare / default repositores in Git. I haven\'t been able to understand quite well (theoretically) about the differences between them, and why I should \"push\" to a bare repository. Here\'s the deal: Currently, I\'m the only one working on a project on 3 different computers, but there will be more people involved in it later, so I\'m using Git for the version control. I clone the bare repo on all computers, and when I finish my modifications on one of

Remove a file from a Git repository without deleting it from the local filesystem

蹲街弑〆低调 提交于 2019-11-26 01:19:20
问题 My initial commit contained some log files. I\'ve added *log to my .gitignore , and now I want to remove the log files from my repository. git rm mylogfile.log will remove a file from the repository, but will also remove it from the local file system. How can I remove this file from the repo without deleting my local copy of the file? 回答1: From the man file: When --cached is given, the staged content has to match either the tip of the branch or the file on disk, allowing the file to be

How do you clone a Git repository into a specific folder?

别等时光非礼了梦想. 提交于 2019-11-26 01:02:23
问题 Executing the command git clone git@github.com:whatever creates a directory in my current folder named whatever, and drops the contents of the Git repository into that folder: /httpdocs/whatever/public My problem is that I need the contents of the Git repository cloned into my current directory so that they appear in the proper location for the web server: /httpdocs/public I know how to move the files after I\'ve cloned the repository, but this seems to break Git, and I\'d like to be able to

Download a single folder or directory from a GitHub repo

假装没事ソ 提交于 2019-11-26 00:38:46
问题 How can I download only a specific folder or directory from a remote Git repo hosted on GitHub? Say the example GitHub repo lives here: git@github.com:foobar/Test.git Its directory structure: Test/ ├── foo/ │ ├── a.py │ └── b.py └── bar/ ├── c.py └── d.py I want to download only the foo folder and not clone the whole Test project. 回答1: Update Sep. 2016: there are a few tools created by the community that can do this for you: GitZip (Credits to Kino - upvote his answer right here!) DownGit

How do you push a tag to a remote repository using Git?

瘦欲@ 提交于 2019-11-26 00:35:00
问题 I have cloned a remote Git repository to my laptop, then I wanted to add a tag so I ran git tag mytag master When I run git tag on my laptop the tag mytag is shown. I then want to push this to the remote repository so I have this tag on all my clients, so I run git push but I got the message: Everything up-to-date And if I go to my desktop and run git pull and then git tag no tags are shown. I have also tried to do a minor change on a file in the project, then push it to the server. After

concept of bare shared repository in git

戏子无情 提交于 2019-11-26 00:34:29
问题 I have been facing difficulty in understanding the bare repository . I have read everywhere that a shared repo is a bare repo. Why must it be a bare repo? Can\'t it be a normal repo which collaborators clone and then push/pull? 回答1: It needs to be a bare repo because a not bare repo would have a working tree (meaning a specific version of that repo checked out and with files visible). Each time you are pushing to a non-bare repo, you have no guarantee that its working tree will reflect what

How to move files from one git repo to another (not a clone), preserving history

﹥>﹥吖頭↗ 提交于 2019-11-26 00:26:29
问题 Our Git repositories started out as parts of a single monster SVN repository where the individual projects each had their own tree like so: project1/branches /tags /trunk project2/branches /tags /trunk Obviously, it was pretty easy to move files from one to another with svn mv . But in Git, each project is in its own repository, and today I was asked to move a subdirectory from project2 to project1 . I did something like this: $ git clone project2 $ cd project2 $ git filter-branch -