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

If your history is sane, you can take the commits out as patch and apply them in the new repository: cd repository git log –pretty=email –patch-with-stat –reverse –full-index –binary — path/to/file_or_folder > patch cd ../another_repository git am –committer-date-is-author-date < ../repository/patch Or in one line git log –pretty=email –patch-with-stat –reverse — path/to/file_or_folder | (cd /path/to/new_repository && … Read more

What’s the -practical- difference between a Bare and non-Bare repository?

Another difference between a bare and non-bare repository is that a bare repository does not have a default remote origin repository: ~/Projects$ git clone –bare test bare Initialized empty Git repository in /home/derek/Projects/bare/ ~/Projects$ cd bare ~/Projects/bare$ git branch -a * master ~/Projects/bare$ cd .. ~/Projects$ git clone test non-bare Initialized empty Git repository in … Read more

How should I deal with “package ‘xxx’ is not available (for R version x.y.z)” warning?

1. You can’t spell The first thing to test is have you spelled the name of the package correctly? Package names are case sensitive in R. 2. You didn’t look in the right repository Next, you should check to see if the package is available. Type setRepositories() See also ?setRepositories. To see which repositories R … Read more

How do you merge two Git repositories?

If you want to merge project-a into project-b: cd path/to/project-b git remote add project-a /path/to/project-a git fetch project-a –tags git merge –allow-unrelated-histories project-a/master # or whichever branch you want to merge git remote remove project-a Taken from: git merge different repositories? This method worked pretty well for me, it’s shorter and in my opinion a … Read more

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

Option A: git clone [email protected]:whatever folder-name Ergo, for right here use: git clone [email protected]:whatever . Option B: Move the .git folder, too. Note that the .git folder is hidden in most graphical file explorers, so be sure to show hidden files. mv /where/it/is/right/now/* /where/I/want/it/ mv /where/it/is/right/now/.* /where/I/want/it/ The first line grabs all normal files, the … Read more