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

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, … Read more

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

I tried to install a package, using install.packages(“foobarbaz”) but received the warning Warning message: package ‘foobarbaz’ is not available (for R version x.y.z) Why doesn’t R think that the package is available? See also these questions referring to specific instances of this problem: My package doesn’t work for R 2.15.2 package ‘Rbbg’ is not available … Read more

How do I rename both a Git local and remote branch name?

I have four branches like master -> origin/regacy, FeatureA -> origin/FeatureA. As you can see, I typed the wrong name. So I want to rename a remote branch name (origin/regacy → origin/legacy or origin/master) I try the command below: git remote rename regacy legacy But Git console returned an error message to me. error : … Read more

How can I keep the content of my pages version controlled?

We have a WordPress-based website that provides documentation to our REST API. Since our API is constantly changing, so is the documentation. However, we would like to keep the documentation version controlled so it can be matched against API commits. Is there a way to have WordPress pages get their content from a remote repository … Read more

Download a single folder or directory from a GitHub repo

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: [email protected]: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 … Read more

How do I clone a subdirectory only of a Git repository?

I have my Git repository which, at the root, has two sub directories: /finisht /static When this was in SVN, /finisht was checked out in one place, while /static was checked out elsewhere, like so: svn co svn+ssh://[email protected]/home/admin/repos/finisht/static static Is there a way to do this with Git? 2 25 What you are trying to … Read more