I tried to get git working on PowerShell as it didn't recognise the command.
Git works now, unfortunately anything else doesn't work anymore. This is also true for git bash (using windows 7). This is quite annoying.
In git bash it says: sh.exe: grunt: command not found
In PowerShell it says something like: the term grunt is not recognized as the name of a cmdlet.
The path to my git folder is as follows: ;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd
Ok, so what I did wrong was, I deleted the entire path line and added the git one, so that's why only git worked. I had to manually add the paths (stacking them after eachother) to nodejs and ruby to make everything work again.
for example: C:\Program Files\nodejs
Related
I'm trying to clone a repository on github into a directory on my computer.
I'm on mac and when i run this code
git clone <git#github.com:melenagrilliot/coding-prework-2023.git>
I'm getting an error sh: parse error near `\n'
Anyone know what I could be doing wrong ?
In the interest of covering all bases, I will assume you have already ran the command without the < >
git clone git#github.com:melenagrilliot/coding-prework-2023.git
If the above doesn't work, then it is not a git related issue. There is something wrong with your shell (sh). The issue might stem from the .profile file in your home directory. Can you please use the following command to copy the contents of your .profile file and share it here?
cat ~/.profile | pbcopy
I have git installed, according to the CLI, it's version '2.36.0.windows.1'.
I have the latest VSCode, version '1.69.1 (user setup)'.
I am on Windows 10 Home, version '21H2 (build 19044)'.
I have a folder which contains my project and a .git subfolder.
Everything works as intended, if I run VSCode as an administrator.
If not, the git repository is not initialized and changes are not tracked.
This is not a huge deal, but i'd actually like to not have to run as administrator.
As far as I can tell the folder (single folder workspace) is trusted, so that shouldn't be it either.
Is there something I am missing, or is this a bug?
When running git status it said that the repository was owned by someone else and that it was not trusted.
It also suggests a command to fix that.
After running this command and restarting vscode, I had my repository as non administrator, so everything was working.
Git bash is closing automatically in a fraction of second after installation how to fix this?
check whether you've installed git properly, open your command prompt or git bash then type
git --version
C:\Users\07>git --version
git version 2.16.1.windows.1
if you're able to get git version something like this then git is installed in your system. If you're getting any errors or not able to open the command prompt or git bash just check whether you've added git path to your system if not add path and check it once again. Refer this for the installation process and check with the release notes as well.
I would like to use WSL (Bash on Windows) Git with VSCode instead of Git for Windows to avoid multiple Git installations.
I created a simple bat script to emulate git.exe comportment by redirecting git commands in WSL. It works nicely in CMD but not with VSCode. Also, WSL is my default terminal in VSCode.
VSCode settings.json:
{
"git.path": "D:\\tools\\git.bat",
"terminal.integrated.shell.windows": "C:\\Windows\\Sysnative\\bash.exe"
}
and git.bat:
#echo off
bash -c 'git %*'
Any idea to make VSCode working with WSL Git ?
Since VS Code 1.34 (April 2019) a remote extension has been introduced to develop into WSL: https://code.visualstudio.com/docs/remote/wsl.
Basically, a server instance of VS Code is started into WSL, allowing you to use all the WSL tools (e.g. git) from your client instance on Windows.
Thank you for pointing that out #Noornashriq Masnon!
I created a small tool to solve this for myself, and hosted it on GitHub.
Basic git functionality seems to work, like viewing changes and committing.
A ready-to-use binary can be downloaded from the Releases page.
One of the problems is that the input paths need to be translated from the Windows representation (C:\Foo\Bar) to the Linux paths in WSL (/mnt/c/Foo/Bar), and back again for paths in the output of git.
For example, the Git plugin in VSCode uses the command
git rev-parse --show-toplevel
to find the root directory of the git repository, but with WSL git this of course returns a Linux path that needs to be translated for VSCode on Windows.
Provide the full path for the bash exec :
git.bat :
#echo off
c:\windows\sysnative\bash.exe -c "git %*"
What you can do is to first try wslpath and if that fails you try a normal git command. It's not ideal but it works.
See: Use WSL git inside VS Code from Windows 10 17046
I have to use TFS for my Mac machine for iPhone app development. So that I have used the following step as from the Git-TF_GettingStarted.html
Extract the contents of Git-TF-Release-Preview.zip to a folder on your local machine,
i.e. C:\git-tf on Windows, or /user/git-tf on Mac/Linux. for installation.
But while giving the command "git tf clone http://myserver:8080/tfs $/TeamProjectA/Main "
an error is coming as
git: 'tf' is not a git command.
Then I have removed the tf from the command, at that time it get worked and asked the username and password, but authentication get failed.
How can I resolve this issue?, if anybody has idea then please help me.
You haven't actually set your PATH variable, which is why you're getting the command not found problem.
If you've set your path, using, as an example: PATH=$PATH:$HOME/git-tf-2.0.2.20130214, then the git command will allow the sub-command tf, which should work like the documentation suggests, as in:
git tf clone …
will work once you've set the PATH variable, otherwise you'll have to reference the git-tf command directly.
The command that is extracted is git-tf, and git is smart enough to look for the git-tf command if you have set the PATH and try to use the operation git tf.
You better go with TFS Everywhere http://www.microsoft.com/en-us/download/details.aspx?id=4240
And use Eclipse like a client for your development in XCode.