Questions tagged [git-bash]

Git Bash is a bash shell bundled with Git for Windows that enables use of Git from the command line.

Git for Windows provides a Bash emulation environment used to run Git and a small set of Unix tools from the command line.

2696 questions
1382
votes
16 answers

How to remove a directory from git repository?

I have 2 directories on my GitHub repository. I'd like to delete one of them. How could I do that without deleting and re-creating entire repository?
Sahat Yalkabov
  • 29,198
  • 40
  • 103
  • 171
1257
votes
19 answers

Ignoring directories in Git repositories on Windows

How can I ignore directories or folders in Git using msysgit on Windows?
sf.
  • 21,036
  • 11
  • 48
  • 57
654
votes
10 answers

Various ways to remove local Git changes

I just cloned a git repository and checked out a branch. I worked on it, and then decided to remove all my local changes, as I wanted the original copy. In short, I had to do the following two commands to remove my local changes git checkout . git…
spiderman
  • 10,160
  • 11
  • 44
  • 81
358
votes
11 answers

Adding Git-Bash to the new Windows Terminal

I'm trying to add a new terminal (Git Bash) to the new Windows Terminal. However, I can't get it to work. I tried changing the commandline property in the profiles array to git-bash.exe but no luck. Does anyone have an idea how to get this to work?
Mendy
  • 4,977
  • 4
  • 19
  • 31
347
votes
22 answers

How do I use Bash on Windows from the Visual Studio Code integrated terminal?

Visual Studio Code on Windows uses PowerShell by default as the integrated terminal. If you want to use Bash from Visual Studio Code, what steps should be followed?
Mahade Walid
  • 7,744
  • 5
  • 14
  • 24
316
votes
18 answers

Git fatal: protocol 'https' is not supported

I am going through Github's forking guide: https://guides.github.com/activities/forking/ and I am trying to clone the repository onto my computer. However, running the command: $ git clone https://github.com/./Spoon-Knife.git Cloning into…
Hank Lin
  • 3,705
  • 2
  • 6
  • 13
292
votes
12 answers

git: 'credential-cache' is not a git command

I followed these instructions to the letter, including the part about password caching. It seems like the instructions are wrong, because every time I git push origin master I get this error: git: 'credential-cache' is not a git command. See 'get…
Big McLargeHuge
  • 11,456
  • 8
  • 64
  • 92
290
votes
15 answers

How to change folder with git bash?

My default git folder is C:\Users\username\.git. What command should I use to go into C:/project?
Sam Mitchell
  • 3,182
  • 2
  • 12
  • 9
284
votes
12 answers

Git for Windows: .bashrc or equivalent configuration files for Git Bash shell

I've just installed Git for Windows and am delighted to see that it installs Bash. I want to customise the shell in the same way I can under Linux (e.g. set up aliases like ll for ls -l), but I can't seem to find .bashrc or equivalent configuration…
iftheshoefritz
  • 4,465
  • 2
  • 29
  • 36
280
votes
20 answers

Python not working in the command line of git bash

Python will not run in git bash (Windows). When I type python in the command line, it takes me to a blank line without saying that it has entered python 2.7.10 like its does in Powershell. It doesn't give me an error message, but python just doesn't…
Caroline Morris
  • 2,801
  • 3
  • 8
  • 5
257
votes
22 answers

How do I change the default location for Git Bash on Windows?

I am using Git on Windows 7 and access my repositories through Git Bash. How can I change the default location that Git Bash opens in a convenient folder when I start it? It's somewhat time consuming to navigate to htdocs, and then a specific…
Alex Waters
  • 3,682
  • 3
  • 22
  • 30
230
votes
24 answers

How to upload a project to Github

After checking Upload my project to github I still have no idea how to get a project uploaded to my Git Hub repository. I'm new to GitHub and I have no idea what to do. I created a repository but i want to upload my project to it. I've looked on the…
jampez77
  • 4,071
  • 7
  • 26
  • 48
211
votes
30 answers

Git bash Error: Could not fork child process: There are no available terminals (-1)

I have had up to 8 git bash terminals running at the same time before. Currently I have only 2 up. I have not seen this error before and I am not understanding what is causing it. Any help would be appreciated! Picture attached:
A. Petrizza
  • 2,854
  • 2
  • 11
  • 22
192
votes
15 answers

How do I avoid typing "git" at the begining of every Git command?

I'm wondering if there's a way to avoid having to type the word git at the beginning of every Git command. It would be nice if there was a way to use the git command only once in the beginning after opening a command prompt to get into "Git…
Nocturnal
  • 1,871
  • 2
  • 8
  • 13
180
votes
16 answers

How to default to other directory instead of home directory

I am developing on a windows machine. The only place I need for linux command line is Git Bash. The problem is: When I open it, I am in the home directory. I have to change the directory to my workspace, like: cd…
Xi 张熹
  • 8,556
  • 16
  • 48
  • 74
1
2 3
99 100