Create remote git repository on Windows machine from Pi - windows

I have a project I built on a raspberry pi, including a git repository. I'd like to make it that when I type git push, it would push to my windows machine (I've had an SD card fail on me in the past, and it cost me lots of code, so I'd like an external backup). I've tried many tutorials, all of which fail due to some reason or other. My latest, is I'm trying to follow this one
I have a windows 10 machine. I went to Control Panel, System and Security, System, and copied the computer name from Computer Name (DESKTOP-UFCQ4N8).
I created a folder called f:\Shared\Git\thermostat. In windows explorer, I right-clicked on here, selected Properties, Sharing tab, and then clicked Share. I added Everyone to users, and clicked share
I then did:
f:\Shared\Git\thermostat>pushd \\DESKTOP-UFCQ4N8\thermostat
Z:\>mkdir MyGitRepo1
Z:\>cd MyGitRepo1
Z:\MyGitRepo1>git init --bare
Initialized empty Git repository in Z:/MyGitRepo1/
Z:\MyGitRepo1>popd
I finally try the following:
pi#raspberrypi:~/devel/thermostat $ git remote add origin file://DESKTOP-UFCQ4N8/thermostat/MyGitRepo1/
pi#raspberrypi:~/devel/thermostat $ git push origin master
fatal: '/thermostat/MyGitRepo1/' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
pi#raspberrypi:~/devel/thermostat $
But it does not seem to recognize the repo. I've spent quite a bit of time playing with different permutations of this, but can't seem to figure out what I'm missing. Does anyone know what I'm doing wrong?

Related

How to create a git repository on a shared windows machine which all developers can push to

I have created a bare Git repository on a shared windows machine on a local area network. I am experiencing a problem in which nobody else but me is able perform a push operation. When trying to sync with or push to the remote repository using the Visual Studio 2013 Git tools, other users receive an error reading "Opening repository: .The following errors were reported during push: refs/heads/master, Failed to rename lockfile to '/refs/heads/master': Access is denied." There seem to be a lot of similar questions about creating a shared repository on stack overflow though none of them have given me the right solution for my problem. One thought is that I may need to create a repository user group, perhaps based on our domain user groups, though I do not have any idea how to do this with Git on Windows and have not found any resources for instructions as of yet.
You can share the folder that contains the bare git repository, and just add those Windows users as people who can read and write to those folders. After making a folder "shared" Windows should tell you what the network path should be. Then it's a simple git clone file:////MACHINE_NAME/path/repo.git.

First push to git repository on LAN gives error

I'm new to Git, and setting up a new repository on one of my own windows servers on my local network, with a view to being able to share source code with another developer on my network.
I have installed Git on my local windows PC, and have created a local repository for one of my existing projects.
I have also set up a shared folder on \myserver\Git Repository\
I have done a commit to the local repository, and am now trying to push that to the shared repository on the server.
I am not 100% sure what format I should be using for my URL, but the most promising error I can get is:
Pushing to file://myserver/Git%20Repository/Inhouse/File%20Comparer/.git
fatal: 'C:/Program Files (x86)/Git/Git Repository/Inhouse/File Comparer/.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Why it is looking in program files folder, I have no idea.
I'm trying to keep things simple (to start of at least), and so have been avoiding using any other protocols.
I've tried googling, to find URL examples, but I just can't seem to get past this error about Got looking for the repository in the program files folder.
Any ideas?
Thanks In advance.
Maya
Got it working!
Instead of googling Git+local network share, I specifically added "windows" to my search too, as all the other information I was finding applied mostly to Linux servers.
This link helped the most:
http://elegantcode.com/2011/06/18/git-on-windows-creating-a-network-shared-central-repository/
I still didn't manage to get the //myserver/myshare/myprjectrepo working, so I mapped the share to a drive letter, and used R:/myprojectrepo instead. All working now.

How do I set up Xcode source control so that my repository can be accessed by two MacBooks?

I have managed to set up Source Control locally on my MacBook (let's call it MacBook1) without any problems.
I would like to set up another MacBook (MacBook2) to access the same repository (the one stored locally on MacBook1). Basically I want both machines to be able to work on the same project at the same time and use MacBook1 as the Git repository and source control server (for lack of a better term).
I've tried clicking on my Wi-Fi status icon and Create Network, but when I do this I can no longer access the internet through Wi-Fi. Also my Git folder for my project is a hidden folder and I cannot seem to select it for sharing.
How can I share my MacBook1 local Git repository across 2 machines?
If you want to keep the repo private then use bitbucket.org, however if you want to make it public then use github.com.
I use bitbucket even though I only generally use one Mac for development as I figure their data handling standards are better than mine and I am less likely to lose data due to disk crashes etc.
You basically create an empty repo on bitbucket and then in your local working repo, do:
$ git remote add origin https://bitbucket.org/YourName/YourRepo.git
$ git push --all
$ git push --tags
(I am not associated with Atlassian).

Missing/corrupt object file errors when using Git repository in Windows 8.1 Skydrive

I like to keep my local Git repos in my Skydrive folder so they sync nicely between machines and I always have an online copy. However, I've recently run into problems after upgrading from Windows 8 to Windows 8.1.
Specifically, I started getting errors that [hash] object was missing or corrupt. After debugging the issue, it turned out that Git was having difficulty with 8.1's new Skydrive integration into the file system. Specifically, 8.1 likes to list files as if they're stored locally, but keep them online until they're accessed. It turned out that right clicking my repo folder and clicking 'make available offline' solved the git errors.
Is there some convenient git or windows setting that I can change to make this unnecessary? It's not a big deal to make files available offline (in fact, I'll probably do that anyway), but I'd like to know if there's a neater solution.
You don't keep a git repo in a synchronized folder (Dropbox, SkyDrive, ...): too many files, too many corruption possibilities.
What you keep is a bundle:
one file
which can be incrementally updated,
and which represents your git repo
and from which you can clone a local repo
See:
"Git with Dropbox"
"Using Dropbox to synchronize files and having them backed up in version control"
"Git with Dropbox Issues"
Or, you can push those repos to a private repo hosting service like BitBucket, as commented by ta.speot.is.

Using GIT to push changes in an environment that didn't get the source from a checkout

I have been using git on my windows box to track a project I am working on alone. I had to copy the files to a linux box. I made substantial edits to the source on the linux box to get it working w/some components also on the linux box. How can I "properly" push the newly edited source on the linux box to the tree on github now?
I tried copying the root of the project on the linux box to my windows machine and did a "git add *" on the windows box at the root, but "git status" makes it look like all the files would be seen as "new", which I do not want. How can I do this without git thinking they're all new files, and instead modified files, as if I had performed all the edits on the windows machine as in the past.
I would accept any answer that gets it done this one time (script, series of git commands, etc).
Also, is the correct way to do this in the future to checkout first on the remote box and then perform edits?
Note: I haven't committed anything to the tree yet. Just the aforementioned copy to the windows machine and then a "git add *" on the windows machine.
If I understood right, you have the same git repo on both machines, but they're independend. If it is so, you can use patch to share changes, see here http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git
Another way might be, if there is a network connection between the machines, and access to the "other" git repository might be possible, you can just pull those changes. See http://book.git-scm.com/3_distributed_workflows.html
If none applies, please provide more information, why this won't work.

Resources