Github Mac App How To Change Default Storage Directory - github

In the github mac app i am trying to change the default directory of one of my repo's. In the settings screen I only see a place to change the remote repo.
Where do I need to go to change the default location? Sorry if it is very obvious.

So after some trial and error I figured out how to change the location after you have set it up. Apparently it is as easy as just moving the folder that contains the .git. So for example I just moved the website folder into a new directory and the GitHub app was able to track the movement.
Edit 1: The move does not always stick so you might have to try a couple of times.

You manage the local destination of each remote repository you clone at the moment of cloning.
As soon as you click the Clone in Desktop button on a repository's page (on github.com), GitHub for Mac should open up (assuming you've configured the app to be opened up when Clone in Desktop is clicked). When the app opens it first prompts you to choose the location for cloning the repo (cloning means downloading or copying the files). This prompt is where you set the default location for this particular repository on your local machine.

In the interest of users who came here with the same doubt, let me post also my experience.
I wanted to move the GitHub local folders away from the "Documents" folder to free up iCloud space, and because I really didn't need yet another copy of the codes in addition to the one in my machine and in the GitHub servers. That is how I landed in this page in the first place. So I simply moved the folders to a local folder that is not synchronised with iCloud and when I opened GitHub Desktop to confirm if things were working, the app told me "Couldn't local [repository X]." They had a "Locate..." button, which I used to let the app know where the new location was. And I did this for all of my locally cloned repos. That's it, works like a charm now. If you have a lot of repos cloned locally, it might be a one-time hassle to do this, but there's no further action.

Related

What happens if I change the folder path of my github project on mac?

I git clone an empty repository on my desktop. I did some commit and push operations. Now I want to change the folder location on my pc, but I don't want to break the connection to github. Should I take some actions before changing the path? Thank you for your help.
I know that for windows users they can change the .git, but I don't know what should be done for mac.

How to re-connect a local github repository I completely overwrote?

I have a Unity project that I messed up badly, so I downloaded the zip file of the latest repository I pushed to GitHub, deleted the local files, and dumped the content of that zip in place of the old directory. I thought this would be a seamless transition, but now GitHub Desktop is not recognizing these files as a git repository. I don't know why because there are github-specific files in there. I have made significant changes that I need to save. How do I reconnect this repository? Do I want to hit "Clone Again" or will that overwrite what I have locally with what is in the cloud? Again, I want to push what I have locally to the cloud.
For anybody else having this problem, here is what I did:
Save your local repository into a zip file someplace accessible,
like your desktop.
Completely gut your local directory--delete all
contents within the root folder. GitHub Desktop demands a clear folder to clone into.
In GitHub Desktop, where it says it
can't find your repository anymore, click the button that says
"Clone Again". This will download your cloud repository into your
local directory--the opposite of what we wanted, but at least what
comes next will work.
Delete all the cloned files that are NOT files associated with GitHub. This will prevent extraneous files from being left over when you overwrite your project files.
Copy all the non-GitHub-related files from the zip into the renewed directory.
This will restore the link between directories. Now, IT IS POSSIBLE that I deleted an essential GitHub file and did not notice (since there are at least 4 of them), and simply restoring THAT file from the cloud would fix everything. If you become disconnected like I was, I recommend trying that first in case it works and saves you time. Those are the files that get overwritten by GitHub when local files are updated.

How to automatically sync files in github desktop?

My partner and I are working on a website and the file folder is being shared between us via github. We need a way of automatically syncing the changes that either of us make to the files on either of our computers so we can both edit the site live.
How can I set it up so that changes made to the repository are automatically synced with files on our computer? Without one of us having to go hit the sync button every time?
You should be able to write a cron job to accomplish the auto sync. But remember git will refuse to sync in case of conflict. You will have to manually pull the changes and resolve conflict.

GitHub for Windows is showing old README text

There is a panel on the right that is supposed to show current content of README.MD. However, I noticed that after changing the content of REAMDE.MD is hasn't updated the text in the panel. Is there a way to forcefully refresh it?
The version of GitHub for Windows I have is 1.0.41.2 (fd3fd236ac85e622194e88f248576b9fe25d28d4)
Yeah, sorry about that. It's a bug and we're working on it. It's currently cached for 30 minutes and sometimes it doesn't expire when it should.
The only way to force a refresh currently is to either delete the entire folder at %LocalAppData%\GitHub\BlobCache.api.github.com or to locate the file in that folder that holds the README content (by looking for keywords that would appear in the README for example) and deleting that.
After a quick search in the \AppData\Local\GitHub folder I found that the old value from README.MD is stored in one of the files in the BlobCache.api.github.com. Deleting the whole folder and restarting the app solved the issue.
Still wondering if there is a proper way for doing that from UI? Shouldn't it happen automatically anyway?
This came from GitHub staff. It tells you how to clear the cache.
WARNING: This will remove GH4W's references to your local repositories
and your logged-in account. You will have to log in again and let GH4W
re-scan your computer for repositories.
There's a known bug where we cache the 'NO README' view if you add a README after adding the repository to GitHub for Windows.
If you'd like to try to get the README to show up, you can delete the cache:
Here are the steps you will need to follow to delete the cache:
Close GitHub for Windows
Open the Git Shell
Run 'github —delete-cache' to clear our the GitHub for Windows cache
Restart GitHub for Windows — you will need to log in and add your repositories again

Windows Github issue pushing a new folder

I'm a VSS (Visual source safe) & Dropbox guy but new to GitHub. I'm using Windows Github tool to manage repositories on our remote server as I concluded in my previous SO post. I was glad to have sought this single point easy to use tool without any need for a deeper knowledge of git.
Things have been working fine until one day I had to add a new folder
to my repository. The Windows Github tool wouldn't recognize the
folder as a new content to be pushed! After some struggle I derived
that it "does" maintain sync with my "initial folders" but simply
creating a new folder in the repository directory wouldn't sync it
like Dropbox!
I searched to know how I can do it or if I had to use GitShell. My bad any I tried it, failed. Finally, I decided to purge everything and re-create the repository folder structure with this new folder like I did with my initial setup. But I don't know how or why it kept saying that the /.git/index file was being used by another process. I tried to empty this folder but it wouldn't. Finally, a logoff was able to free that file for me and I re-created everything. Pheew!
I might be doing it wrong as a newbie or even misusing Git due to my Dropbox habits. Pls correct me! What would be the best way?
My usage is more like VSS & dropbox(with version control) in a small remotely connected team. I started with this simple Windows Github tutorial. What about the following two -
TortoiseGit
msysgit
Do they provide better management? Pls suggest if Windows GitHub is the best (if so how to add folders later?)
Just in case, do note that adding a folder won't trigger anything for Git: you won't be able to push it if that folder is empty, because Git will consider it as "no content", and will ignore that new folder.
See also "How do I add an empty directory to a git repository?".
If you add a folder and some files in it, then the GitHub for Windows interface will detect that new content, and ask you to add and commit, which means you will be able to push.