All Questions
1,721
questions
3482
votes
41
answers
1.5m
views
Git is not working after macOS update ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools")
I updated to the latest OS, and/or restarted my computer (this happens on every major update, but this time all I did was restart my computer on 2022-09-13).
This morning I navigated to my work's ...
1779
votes
32
answers
1.1m
views
How can I Remove .DS_Store files from a Git repository?
How can I remove those annoying Mac OS X .DS_Store files from a Git repository?
994
votes
35
answers
1.5m
views
How do I update the password for Git?
I'm using BitBucket with Xcode and Git for version control, and recently I changed all of my passwords (thanks Adobe!).
Unsurprisingly, I'm no longer able to push my local commits to my repository on ...
962
votes
21
answers
344k
views
Git ignore file for Xcode projects
Which files should I include in .gitignore when using Git in conjunction with Xcode?
902
votes
12
answers
507k
views
.gitignore all the .DS_Store files in every folder and subfolder
I've added .DS_Store to the .gitignore file, but it seems that it is only ignoring .DS_Store in the root directory, not in every folder and subfolder.
How do I fix this?
865
votes
10
answers
1.0m
views
Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch
I am using Git. I did a pull from a remote repo and got an error message:
Please enter a commit message to explain why this merge is necessary,
especially if it merges an updated upstream into a ...
397
votes
19
answers
412k
views
How to upgrade Git to latest version on macOS?
I just bought a new Mac and I checked in the Terminal what version of git is installed by default. I got the answer
git --version
> git version 1.7.5.4
I would like to upgrade git to the latest ...
345
votes
15
answers
255k
views
Install gitk on Mac
How can I install gitk on a Mac?
From their official website, it seems gitk comes with Git, but the version of my Git (git version 1.7.12.4 (Apple Git-37)) does not come with gitk.
brew install gitk ...
322
votes
9
answers
126k
views
I change the capitalization of a directory and Git doesn't seem to pick up on it
I'm developing a project on OS X Lion that is under Git version control. I had these lowercase directories and then later capitalized them (e.g. emailaddresses => EmailAddresses), but Git doesn't seem ...
310
votes
12
answers
113k
views
git mv and only change case of directory
While I found similar question I didn't find an answer to my problem
When I try to rename the directory from FOO to foo via git mv FOO foo I get
fatal: renaming 'FOO' failed: Invalid argument
OK. ...
270
votes
1
answer
85k
views
Git doesn't work on MacOS Catalina: "xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing" [duplicate]
After upgrading to MacOS X 10.15 Catalina, I cannot run any git commands in my shell:
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For ...
247
votes
21
answers
158k
views
(Mac) -bash: __git_ps1: command not found
I'm trying to change my command promt in terminal. I keep getting the error:
-bash: __git_ps1: command not found
I've tried it just by typing it into the terminal as is: __git_ps1. I've also tried it ...
206
votes
6
answers
83k
views
How to configure Mac OS X term so that git has color? [closed]
I've seen a Mac OS X git demo online in which it's configured to have multiple colors.
For example, his prompt is amber, his ls directory is purple and his git diff output has ~ 4 colors (pink, light ...
193
votes
4
answers
340k
views
How to locate the git config file in Mac [duplicate]
As title reads, how to locate the git config file in Mac? Not sure how to find it. Need to set
git config --global http.postBuffer 524288000
Need some guidance on finding it..
181
votes
20
answers
73k
views
Homebrew’s `git` not using completion
When using OSX’s git, after I modify a file I can simply do git commit <tab>, and that’ll auto complete the file’s name to the one that was modified. However, if I install a newer version of git ...
162
votes
13
answers
291k
views
How do you reset the stored credentials in 'git credential-osxkeychain'?
I've followed the GitHub instructions for setting up my account, and I'm able to clone, but I'm unable to push remotely.
When I do a "git push" I get the 403 error. It has the correct URL. I tried a "...
159
votes
18
answers
265k
views
How can I display the current branch and folder path in terminal?
I've been watching some of the Team Treehouse videos and they have a very nice looking terminal when working with Git.
For example they have (something similar):
mike@treehouseMac: [/Work/test - ...
142
votes
11
answers
236k
views
Locate Git installation folder on Mac OS X
I'm just curious, Where Git get installed (via DMG) on Mac OS X file system?
128
votes
7
answers
55k
views
Should I git ignore xcodeproject/project.pbxproj file?
in a XCode project, I offen got xcodeproject/project.pbxproj file changed, but useless info for me, it for compile.
Should I git ignore this file and xcodeproject/projectxworkspace/username....
122
votes
21
answers
99k
views
OS X - Can't start Git: /usr/bin/git Probably the path to Git executable is not valid
I get this error in Android Studio:
Can't start Git: /usr/bin/git
Probably the path to Git executable is not valid.
It gives me an option to fix it, where it takes me to the area in ...
118
votes
10
answers
267k
views
Git error "fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree"
I'm trying to initialize a new Git repository from Debian (actually a VM on VirtualBox, installed and running on Mac OS X):
cd ~
mkdir test
cd test
git init
Initialized empty Git repository in /home/...
116
votes
7
answers
235k
views
How to add /usr/local/bin in $PATH on Mac
When I do 'open .profile' in the terminal I have the following:
export PATH=$PATH:/usr/local/git/bin
Now I installed node.js for Mac and it says,
Make sure that /usr/local/bin is in your $PATH.
...
110
votes
10
answers
63k
views
git - gpg onto mac osx: error: gpg failed to sign the data
I installed GPG from brew.
brew install gpg
It is gnupg2-2.0.30_2.
When I commit, I do get a error message:
You need a passphrase to unlock the secret key for
user: "Max Mustermann (mycomment) <...
109
votes
10
answers
114k
views
Show system files / Show git ignore in osx
By default it is not possible to see .gitignore files in osx. What is command to reveal these files?
106
votes
5
answers
49k
views
Switching branch on Xcode 9
I am having trouble finding the menu item to switch branch using Xcode 9. The working copies menu seems to have disappeared. Any ideas?
Xcode 9
Xcode 8
101
votes
9
answers
192k
views
How to discard uncommitted changes in SourceTree?
I'm new to the Git environment, and I'm using BitBucket with SourceTree on Mac. All I want to do now is to discard the changes since last commit. How should I do this? I haven't found anything like &...
80
votes
6
answers
111k
views
Git on Mac OS X v10.7 (Lion)
I just upgraded my Mac to Mac OS X v10.7 (Lion), and now Git is gone:
$ git
-bash: git: command not found
How can I get Git back?
78
votes
3
answers
253k
views
No such keg: /usr/local/Cellar/git
I have been struggling with this for a few hours. I am on a Mac using Yosemite. I had homebrew installed, and was using git just fine. I tried doing $git add -i and I got this error:
Can't locate ...
76
votes
7
answers
23k
views
How to get rid of ESC[ characters when using git diff on Mac OS X Mavericks?
Since I installed OS X Mavericks, the result of the command git diff is rendering ESC[xxx characters like this:
ESC[1mdiff --git a/console/org.linkedin.glu.console-webapp/decorate-grails-methods-...
75
votes
2
answers
16k
views
How to suppress the editor for `git rebase --continue`?
I'm often rebasing interactive to make tiny changes in the history (for example removing a blank line, or editing one line). In most cases those changes are based on some peer review.
At first I do my ...
74
votes
7
answers
19k
views
Git and the Umlaut problem on Mac OS X
Today I discovered a bug for Git on Mac OS X.
For example, I will commit a file with the name überschrift.txt with the German special character Ü at the beginning. From the command git ...
72
votes
3
answers
41k
views
Homebrew update fail: "Please, commit your changes or stash them before you can merge"
I am running:
brew update
And I get an error:
error: Your local changes to the following files would be overwritten by merge:
samtools.rb
Please, commit your changes or stash them before you ...
69
votes
11
answers
18k
views
How to ignore Icon? in git
While trying to setup a dropbox folder with git, I saw a "Icon\r" file which is not created by me. I try to ignore it in the ~/.gitignore file. But adding Icon\r Icon\r\r Icon? won't work at all.
69
votes
3
answers
25k
views
Git not removing files when switching branch
Sometimes when switching branches using Git (version 1.7.2.1)
it does not seem to remove the files/directories I created specific to the branch I switched away from.
Neither does it list it as ...
64
votes
7
answers
359k
views
How to Run Terminal as Administrator on Mac Pro
I am using a Mac for the first time and need to run Terminal as an admin. I have installed NodeJs and Git and want to download Phone Gap/Corova but when I try to install Cordova, it comes back with an ...
64
votes
2
answers
50k
views
How to configure kdiff3 instead of emerge as a git mergetool?
I have Git on mac OSX Snow Leopard and I tried to edit my merge and diff tool to use kdiff3 instead of emerge.
But when I try to use it does not launch the GUI of kdiff and keeps me with a cmd based ...
58
votes
11
answers
23k
views
scrolling down git diff from mac terminal
I am using git on terminal on OS X 10 Yosemite.
When I do git diff I get long list of changes and sometimes I just need to scroll to the end but I couldn't figure out a way to do that other than to ...
58
votes
1
answer
31k
views
How to use git mergetool's filemerge
The documentation is here: http://www.kernel.org/pub/software/scm/git/docs/git-mergetool.html
A handy guide is here: http://ryanflorence.com/git-for-beginners/
However, neither of them explain how to ...
57
votes
1
answer
8k
views
How to handle Asian characters in file names in Git on OS X
I'm on US-English OS X 10.6.4 and try to store files with Asian characters in its name in a Git repository.
OK, let's create such a file in a Git working tree:
$ touch どうもありがとうミスターロボット.txt
Git ...
55
votes
2
answers
168k
views
How to access and modify a SSH file on mac? [closed]
I'm trying to setup SSH on my computer but not sure how to access the ~/.ssh/config file. From github's website they mention this file has to be modified but I'm not sure where its located or how to ...
54
votes
20
answers
101k
views
Homebrew install: Failed during: git fetch origin master:refs/remotes/origin/master -n --depth=1
I ran the following command on terminal (Mac El Capitan)
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
and got the following error message:
...
54
votes
7
answers
67k
views
Setting Visual Studio Code as my Mac's default editor (including editing Git commits)
I am trying to configure my Mac Book Pro (OSX El Capitan 10.11.1) to use Visual Studio Code as its default editor. I have created a ~/.bash_profile file with the following two lines
vscode () { ...
52
votes
14
answers
9k
views
git-gui command crashes on macOS Sierra
After update to macOS Sierra, git-gui command crashes with an error:
Wish[23862:202062] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: ...
52
votes
4
answers
49k
views
Case-sensitive path collisions on case-insensitive file system when I do git clone
when I git clone the repository the following warning appears:
...
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
...
51
votes
5
answers
12k
views
Using vim for git commit messages broken after updating janus
After updating the janus vim distribution there appears to be a problem with using vim for commit messages. The best example of this is when doing a git pull to get someone else's changes. The vim ...
51
votes
3
answers
23k
views
Git: File Rename
I wanted to rename a folder from "Frameworks" to "frameworks", but git would not let me add the new lowercase name. I guess it treats filenames case insensitive, does it?
A git add frameworks/ -f ...
50
votes
9
answers
113k
views
remove .git/index.lock': Permission denied
I'm completely stuck as to why my git has completely locked me out. I have a laptop that I use at work and when I'm home. For both accounts I use git extensively and both are located in different ...
49
votes
11
answers
65k
views
Is there a good (visual) Git tool for Mac OS X or Windows? [closed]
I'm looking at porting my projects to Git from SVN (I'm convinced that Git is worth the move) and I'm trying to come up with a set of tools to use for the project. I've googled around for some tools ...
48
votes
4
answers
11k
views
Git diff: Write output and exit instead of interactive mode
When I run git diff on my OSX command line, the output is displayed inside a less or vim interface. The interface lets me to scroll up and down, and quit using the q key.
This is very annoying, ...
46
votes
4
answers
32k
views
Set Visual Studio Code to be global Git editor on OSX
I want to set VS Code to be my default git editor for commands such as rebase. This doesn't seem to be documented on the VS Code website. I've found a SO question about doing it for Windows, which ...