Showing posts with label git bash. Show all posts
Showing posts with label git bash. Show all posts

Wednesday, November 27, 2019

Git Bash | Changing a remote's URL | How to Change a Git Remote's URL | How Save Username/Password/Credentials For Git Repository in Git Bash

Got to the directory where the repository is located using Git Bash:

cd /path/to/repository
Run git remote to list the existing remotes and see their names and URLs:

git remote -v

The output will look something like this:

origin https://pritomkucse@bitbucket.org/pritomkucse/demo_project.git (fetch)
origin https://pritomkucse@bitbucket.org/pritomkucse/demo_project.git (push)
For example, to change the URL of the origin to some other repo you would type:

git remote set-url origin https://pritomkucse:your_password@bitbucket.org/pritomkucse/demo_project_2.git
Verify that the remote URL has changed using the same command git remote -v

Friday, April 7, 2017

Git Bash Inside PhpStorm

It would be very helpful if we can use Git Bash inside PhpStorm itself.
The fact is, though, that it's a terminal client and that's how PhpStorm thinks of it. To implement it, you have to go to:

>> File -> Settings -> Tools -> Terminal

Once you're there, here are the steps necessary to enable Git Bash in the Terminal dialogue. 
Now you can browse git.sh file from your git installation location. 
That would be like below path:
C:\Program Files\Git\bin\sh.exe and it may differ in your machine

And then need to bound the path by double quotation like:
"C:\Program Files\Git\bin\sh.exe" 

And add the following line after that "-login -i"

And the final output be like:
"C:\Program Files\Git\bin\sh.exe" -login -i

Your set-up is completed, now press Alt+F12 to see git window inside PhpStorm.

And your are done.

Friday, November 11, 2016

Git - fatal: Unable to create '/path/my_project/.git/index.lock': File exists

Execute the command below:

rm -f ./.git/index.lock

If you have no other git processes running (which is the normal case), go ahead and delete that file.

Untrack files from git using git bash

This will start ignoring the changes to the file:
git update-index --assume-unchanged path/to/file 

When you want to start keeping track again: 
git update-index --no-assume-unchanged path/to/file 

Now list files that are ignored: 
git ls-files -v 

And with a search options: 
git ls-files -v | grep "file_name_part"