How to change the path where Git creates ssh file while "remote add origin ..."? - windows

Good times!
Please, hint me this moment - I use the Windows account with cyrillic account-name. When I try to add my local git repository to github.com, I get the mistake "Could not create directory c/Users/\204\206" ... and I suspect due to my account is cyrillic.
So - how to change this behavior? I want to use Git without changing or renaming account?

Git doesn't create any directories when you add a remote repository. That is, if you type a command like this:
git remote add origin git#github.com:you/yourproject.git
The only thing that happens is that git adds a couple of lines to the .git/config file.

Related

something went wrong when pushing to github with webstorm

As is shown in the image,I'm not sure if the failure is caused by some missing property while setting up webstorm .
The issue is not resolved after a lot of efforts.As a learner,I don't know what to do now.
Meanwhile,something seems wrong as shown in git bash.I've no idea whether the two are directly related.
If you have ever faced these difficulties,could you please give me some idea? Even if it's only a web address.
What I want to do is only pushing my code. Anyone who pushed successfully in any other way will be welcomed to share your method.
If I'm being honest I'm not sure that I completely understand your question, but I will supply some information that will hopefully lead you down the right track.
First in the bash shell, cd (change directory) into your project directory like this:
$ cd /c/foo/bar/yourprojectfolder
In your project top most directory, do you have a .git folder? You may have to show hidden folders in windows to see this directory. If not, you need to initialize a repository with the init command.
$ git init
Initialized empty Git repository in C:/foo/bar/yourprojectfolder/.git/
After running this command, you should see a .git folder inside of the directory you changed to (used cd to get to) earlier.
Next, in order to push, you first need a remote repository to push to. Based on your first picture, I believe that you have successfully created a repository on GitHub. If not however, just log into GitHub and click the 'New Repository' button:
Once a repo has been created, you need to add it as a remote to your local git (in git bash). To do this you need a url (either SSH or HTTPS) to your repo. You can find this url inside of your repository in online GitHub. If you are not certain you have set up SSH, it's best to use the HTTPS url. It should look something like this, but the url itself will be different and specific to your repository:
Copy that url to your clipboard, and then back in git bash run:
$ git remote add origin <PASTE YOUR URL HERE>
You need to make an initial commit of your code to have something to push:
$ git add .
$ git commit -m "Initial commit"
Finally, with the origin repo set up and a commit made, you should be able to push to your origin repo
$ git push -u origin master
You should now be able to view your code on GitHub.

git clone from bare repository

I created a Visual Studio project using git, later I created a remote bare repository in the path \\xxx.yyy.com\dfs\CORP\Wkg\MoDat\tmp\avl\Repository\WCF\MIlib and added it as origin in Visual Studio, then pushed.
Remote repository seems to be up to date, and from command line a git remote -v in the local folder returns these 2 lines
origin \corp.repower.com\dfs\CORP\Wkg\MoDat\tmp\avl\Repository\WCF\MIlib (fetch)
origin \corp.repower.com\dfs\CORP\Wkg\MoDat\tmp\avl\Repository\WCF\MIlib (push)
I assume I can clone to another local folder from the remote path, so I just copied and pasted exactly the line above to clone it elsewhere
git clone "\\xxx.yyy.com\dfs\CORP\Wkg\MoDat\tmp\avl\Repository\WCF\MIlib" .
Now I get an error
git : Cloning into '.'...
fatal: '\xxx.yyy.com\dfs\CORP\Wkg\MoDat\tmp\avl\Repository\WCF\MIlib' 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 am cloning in the same system in another folder using the same (administrator) user, so it's definitly not relate to access right.
I see in the error that a \ is missing, am I doing something wrong? should the path be somehow escaped?
Are you writing these commands in some kind of bash?
When I was working on Windows I always used forward slashes / instead of backslashes. See if it works for you.

Github and Heroku Cloning error - invalid path/syntax error

Here is my problem
I am using heroku to develop an app and I am using github along with it for a project.
Now when I try and use github(clone) without heroku to work on a different project it says...
michael#michael-HP-PavilionNotebook-PC:~$
michael#michael-HP-PavilionNotebook-PC:~$
michael#michael-HP-PavilionNotebook-PC:~$ git init
Initialized empty Git repository in /home/michael/.git/
michael#michael-HP-PavilionNotebook-PC:~$ ls
Desktop Downloads gifiniti Music Pictures Templates Ubuntu One
Documents examples.desktop gifinitiApr24 oldgifiniti Public tmp Videos
michael#michael-HP-PavilionNotebook-PC:~$ git clone git#github.com:toadiferus/SecretTunnel
Cloning into SecretTunnel...
! Invalid path.
! Syntax is: git#heroku.com:<app>.git where <app> is your app's name.
fatal: The remote end hung up unexpectedly
michael#michael-HP-Pavilion-dv6700-Notebook-PC:~$
How would I resolve this error? Can't find any support online for this specific problem.
HOw can I change the syntax of the commands? I want to just clone a project from github not heroku.
THANKS!
Michael
Your ~/.ssh/config may have been hijacked by if you used the heroku accounts plugin. Same thing happened to me. I removed the contents of my ssh config and all is well!
Firstly, you don't need to init before you clone - init is used to turn a project folder into a git repository unless you really intended to turn your entire user directory into a git repo? I would suggest you delete the .git folder that would have been created from your doing this.
To be sure you're using the correct path go to your projects on github and use the icon that looks like a clipboard to copy the correct url to your clipboard, paste onto your command line and see what happens then.
I also don't understand why when you do a
git clone git#github.com:toadiferus/SecretTunnel
Cloning into SecretTunnel...
you get what looks like a Heroku push error??? Git clone from a github URL should simply clone the project from github to your local machine.
! Invalid path.
! Syntax is: git#heroku.com:<app>.git where <app> is your app's name.
Are you editing the output you are pasting?
The git url should have .git on the end, ie. git#github.com:toadiferus/SecretTunnel.git.

Setting up a Git repository on MacOS X with network drive

The given:
A mac with my work folder set up as Git repository.
A network drive (Seagate FreeAgent GoFlex Home, if that helps).
The task:
Set up the specific folder on my network drive as a place where a backup of my repository can be stored.
What I tried:
Setting up the location through Volumes path as a Remote (via Add Remote in Git GUI) - returned with:
fatal: GIT_WORK_TREE (or --work-tree=<directory>) is not allowed without specifying GIT_DIR (or --git-dir=<directory>
Then, I tried
git --git-dir=Volumes/xxxxxxx/GoFlex_Home/Personal/xxxxxxxx
in the terminal, and though it did not turn up with an error, it does not appear to be of result, as another try to add remote ended with the same error as above.
After that, I started to have doubts if specifying the path to network drive through Volumes and/or trying to add it as remote are the right things to do to solve the task. Maybe there are other ways to accomplish the goal that I am not yet aware of?
I assume you get these errors because nothing exist yet in the network share. A remote must point to an existing repository, so you first have to clone it: in the original repo do:
git clone --bare . /Volumes/xxxxxxx/GoFlex_Home/Personal/xxxxxxxx
This will copy your repository data to the network folder.
Then you can add it as a remote:
git remote add --mirror=push backup /Volumes/xxxxxxx/GoFlex_Home/Personal/xxxxxxxx
You will be able to synchronize both with:
git push backup

Tower (Git client) not cloning all directories to the local machine from the remote repository

I have an issue with a new remote repository that when cloned using Tower, doesn't clone all the directories.
When I created the remote repository, I did the following:
Created a .gitignore file containing the following line
files/cache/*
Then ran:
git init
git add .
git commit
I then cloned the remote repository to my local machine using a Mac OSX git client called Tower but noticed that many of the directories did not clone.
When I go back and look at my terminal session on the webserver, I can see the directories that weren't cloned listed after the initial commit - I see a whole bunch of lines that look like this:
create mode 10644 directory-name/path/to/file.php
create mode 10644 directory-name/path/file.php
create mode 10644 directory-name/path/to/file.php
create mode 10644 directory-name/path/file.php
So I'm guessing they were added but I'm also wondering if my .gitignore file is not setup right and is conflicting with Tower somehow?
I tried the .gitignore file a couple of ways, firstly like this:
files/cache/*
then like this:
files/cache/
After changing it to the second one, I ran git add -A (which didn't seem to add anything new) on the server and pulled the repo down using Tower again - but no luck.
Not sure if this is Git or Tower or both - not sure what I'm doing wrong, sorry.
Any help would be much appreciated.
Cheers
Ben
Don't forget that git won't add (and clone) empty directories.
(or directories with ignored content, making them empty for Git)
See:
"Does git ignore empty folders?"
"How do I add an empty directory to a git repository?"

Resources