Yesterday I started using Git to version control documents I'm working on. I use two systems, a Windows 10 desktop, and a MacBook Air. I save the documents to a directory on the internet, think Dropbox.
I configured Git to use the internet directory for Windows 10. Is it also possible to use this same directory for Git on my Mac? Or do I instruct my Git on the Mac to use a different directory on the Mac?
Git Mac: 2.15.1 (No manual entry for gitwork-tree)
Git Windows 10: 2.16.2.windows.1
Every version control system maintains the directory name of the local folder the same name as the repository (Source Folder). Then if you clone your project from git repository ( git clone https://github.com/myaccount/my-project ) the diretory name in any Operating System will be the same of the repository "my-project".
Related
I am working on a project at work and would like to work on it at home as well. I synced the Xcode project to a remote repository to github from my work's mac. I am wondering how I can get a copy on my home's mac and sync it so that I will be able to push commits and pull?
A simple
git clone https://....yourRepositoriy/ongithub
You have to run this with git installed from the Terminal
Should work and copy all files to your local machine
I want to install Git for Windows on my working machine. The problem is I don't have the necessary permissions in Program Files and noone will grant me these (company policy). Is there any workaround?
Use this version:
Git Portable
https://github.com/sheabunge/GitPortable
Git Portable is a portable version of Git for Windows packaged in PortableApps.com Format.
# ... Copy the GitPortable directory from this repository to a location of your choice.
I just installed Git on my PC (Windows 8.1 Pro) and cloned my repository (containing about 5000 .c and .h files) from Github via git clone. Now if I say git status, it shows five modified files (the changes show some words replaced by others).
The problem is that I can't commit this; if I try git add . in my project's root directory, nothing happens. Running git status after still lists five files as modified. Running git commit doesn't remedy the situation.
I am running on the newest version of git on windows
How can I get this to work?
I found the answer..
I had to install cygwin with integrated git package and clone the repository with cygwin, then commit and work with cygwin. I can use windows editors to edit the files!
I have installed cygwin on a windows server, solely for use of ssh.
In addition, I've installed Git for Windows, having discounted the use of Cygwin git as it doesn't support the windows extensions.
I have a git ssh user which can login (via ssh) and can create the repositories under this user's home directory. This allows me to push to the server from OSX running SourceTree. In this case, the repository is located with: -
git#GitServer:Repos/Project.git
The actual path to the folder under cygwin is: -
/cygwin/home/git/Repos/Project.git
However, I want to be able to have the Repos directory placed directly at the root of the cygwin folder, not under a home folder: -
/Repos/Project.git
Doing this causes SourceTree to fail when trying to push to the repo. I'm defining the path like this: -
git#GitServer:/Repos/Project.git
I have also checked permissions on the folders and this is not the issue.
The failure results in this message: -
fatal: '/Repos/Project.git' 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.
I can understand that I'd have problems if the repo was placed outside of the cygwin folder, but should it not be possible for it to be placed at the root and can anyone explain how I can get the SourceTree path to access the repo, if it's placed at the root, without having to create symbolic links?
So you have a directory with Git repositories placed in the Cygwin's root directory. I will expect, that your Cygwin's root directory is c:\cygwin, so directory with the Git repository is c:\cygwin\Repos\Project.git. Cygwin's root directory is mounted as / in Cygwin, so your Git repository directory is /Repos/Project.git.
SourceTree is native Windows .NET application, so it uses Windows file system and Windows style paths. Therefore if you said SourceTree to look for Git repository in /Repos/Project.git, it was trying to find it in c:\Repos\Project.git, which is obviously wrong. Just set it to proper Windows path in SourceTree and it will work.
It's the same for any Windows application. Cygwin's path is understood only by Cygwin applications. You can use cygpath to convert Cygwin paths to Windows and vice versa. This command for example opens current directory in Cygwin in Windows Explorer:
explorer `cygpath -wa .`
Also repository can be placed anywhere you want of course, it doesn't have to be under Cygwin's root directory. It can be even on a different drive. Cygwin mounts all Windows drives as /cygdrive/<drive-letter> automatically by default, so e.g. d:\Repos is accessible as /cygdrive/d/Repos in Cygwin. You can also create a symbolic link to any directory outside of Cygwin, so you can have e.g. /cygdrive/d/Repos linked as ~/Repos for faster access from Cygwin.
Just one simple rule: under Cygwin use Cygwin style paths, under Windows use Windows style paths.
I want to be able to sync a work repo from my Windows 7 desktop to my Windows 7 laptop without pushing my commits to our main server. How do I do this? I can't figure out how to set up a remote path so that git can understand where it is. I generally use Git Bash for dealing with git, not the windows commandline, so the issue here is likely that I can't figure out how to write a path in Git Bash which will reference a windows share.
So, say I have a repo at (windows share path):
\\\\MyWorkPCName\dev\myrepo\
And in the command line, I can access the directories and files (albeit using pushd since cmd is stupid), how do I convert this in to a valid git remote?
While Git doesn't recognize backslashes, Windows does recognize forward slashes:
git remote add desktop //MyWorkPCName/dev/myrepo
Git Bash also lets you access windows drives using UNIX-style paths, e.g. C:\Users\bug\repo becomes /c/Users/bug/repo.