0

I want to modify a repo from two sources: windows OS and Ubuntu OS (Dual booting on a laptop). The repo contains files from my Arduino library directory (I'm using the repo as a place to keep changes to the library the same across OS).

Is it possible for me to get the content of the repo without having to rename the arduino library directory name (Arduino software looks for a folder called 'libraries' so I can't change its name).

Minh Tran
  • 494
  • 7
  • 17

1 Answers1

0

When you clone a repo, git defaults to placing it inside a folder with the same name as the repo, but this is not required. You can name it whatever you want. So you likely want to run some git clone git@github.com:/your/repo libraries to get the repo content in that path.

You can also rename the repo folder after cloning if you already have it but need the path to be different on your system.

I'm not sure if you have everything in libraries checked in or not, but if you have only certain directories in git you might be able to keep the repo somewhere else on disk and symlink from libraries/library1 -> /path/to/your-repo/library1

Community
  • 1
  • 1
David Ulrich
  • 119
  • 4
  • If I clone the repo and rename it, will github still know that I want to push to the repo from which I cloned? (how?) – Minh Tran Jan 17 '16 at 02:29
  • @MinhTran Yes, git stores the repos in knows about as remotes. `git remote -v` will show the repos it knows about. The most common is if you clone from github, something like `origin git@github.com:/dulrich/scripts.git (fetch)` if that is what you cloned. By default the place you cloned from is called `origin`, but you may have other remotes, such as other people's forks of a project for example. [git scm](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) has more details if you need to work with multiple remotes. – David Ulrich Jan 22 '16 at 04:18