Questions tagged [git]

Git is an open source distributed version control system originally designed and written by Linus Torvalds. It is generally used to keep track of source code for software projects. As a DVCS, Git provides powerful help with branching, merging, and distributed development.

Filter by
Sorted by
Tagged with
128 votes
8 answers
67k views

Forward SSH traffic through a middle machine

SSH tunneling is very confusing to me. I am wondering if I can do this in Linux. I have 3 machines.. A. My local machine at home. B. Machine at work that I can SSH into (middle man). C. My desktop ...
user avatar
124 votes
6 answers
71k views

Git Bash Here in ConEmu

How do I create a right-click context menu entry to open Git Bash at a given folder within ConEmu? See Git Bash Here in Console2 for the equivalent question for Console2.
Charles Roper's user avatar
96 votes
14 answers
63k views

How to get git-completion.bash to work on Mac OS X?

I have followed http://blog.bitfluent.com/post/27983389/git-utilities-you-cant-live-without to add git-completion.bash to my /opt/local/etc/bash_completion.d/git-completion and I put PS1='\h:\W$(...
n179911's user avatar
  • 3,673
1146 votes
25 answers
1.4m views

How to tell git which private key to use?

ssh has the -i option to tell which private key file to use when authenticating: -i identity_fileSelects a file from which the identity (private key) for RSA or DSA authentication is read.  The ...
jrdioko's user avatar
  • 12.9k
24 votes
1 answer
9k views

Using the IdentityFile directive in ssh_config when AgentForwarding is in use

Is it possible to specify forwarded keys using the IdentityFile directive in .ssh/config? I ran into this quirk when trying to deploy some code via Capistrano/GIT on our production server. Both my ...
skryl's user avatar
  • 385
5 votes
2 answers
2k views

How to keep my OSX settings under version-control?

Coming from Linux, I've gotten in the habit of keeping my config files under a git repository. Since I got a macbook however, I've made a lot of tweaks through defaults write and preferences panels, ...
julien's user avatar
  • 1,546
28 votes
7 answers
48k views

Git SSH "permission denied" in macOS 13 Ventura

When I try to authenticate with an RSA SSH key in macOS 13 (Ventura), I get a Permission denied (publickey) error. However, when I use the same command against macOS 12 (Monterrey), it works correctly....
Haozhe Xie's user avatar
  • 1,249
271 votes
11 answers
171k views

Can you GPG sign old commits?

Git now has the ability to sign commits with git commit -S, which is great, but sometimes I forget the flag to commit, and sometimes I mail myself patches which I apply with am, and that command doesn'...
Magnus's user avatar
  • 4,376
14 votes
3 answers
20k views

How to install mintty into 'Git Bash' on windows?

I have installed git on windows from http://git-scm.com/download/win and I use the Git Bash shortcut to access git commands. Unfortunately, Git Bash uses the Windows Command (CMD.EXE) Terminal which ...
Chris Snow's user avatar
2 votes
2 answers
8k views

GitHub for Windows not working after install

Today I have installed GitHub For Windows. I had installed GitHub for Windows earlier and at that time it worked fine, but due to some reason I had to uninstall it. Today when I installed GitHub ...
Kartik's user avatar
  • 163
105 votes
11 answers
269k views

How should I set the PATH variable on my Mac so the Hombrew-installed tools are found?

Trying to set up Homebrew on a new Mac (on previous Macs I would install packages from source). The first package I tried to install was Git: $ brew install git Installation went OK, but which git ...
Meltemi's user avatar
  • 6,967
102 votes
4 answers
75k views

Using Multiple SSH Public Keys

I have a personal account and a company account on Unfuddle. On Unfuddle SSH keys can only be used on a single account, so I need to create a seperate SSH key on my laptop for both accounts. I ran ...
Dave Long's user avatar
  • 1,155
100 votes
11 answers
130k views

How to add the 'tree' command to git-bash in Windows?

I'm using git-bash in Windows 7. I'd like to see a tree of the current directory. However jcollum@DEVELOPER01 ~/Dev/express_coffee $ tree . sh....
jcollum's user avatar
  • 5,163
54 votes
4 answers
162k views

How do I disable password prompts when doing git push/pull?

Every time I want to push and/or pull from the terminal (in Linux) I have to enter a password. How do I remove this so that it pulls and/or pushes without the password?
whirlwin's user avatar
  • 837
47 votes
4 answers
18k views

Git Bash Here in Console2?

MSysGit installs a context menu item that opens a Git Bash prompt at the currently selected folder; however, this opens a cmd.exe window and I would like it to open in Console2 instead. What ...
Charles Roper's user avatar
22 votes
10 answers
25k views

How to upgrade Git on Ubuntu Hardy?

I have Git version 1.5.4.3 installed, but I think this must be an old version. I'm running Ubuntu Hardy 8.04. I need to install at least version 1.6 to get a Git GUI to work. How do I upgrade my ...
Andrew's user avatar
  • 14.9k
11 votes
2 answers
3k views

How to track $HOME with git

I would like to track my $HOME dir with git. I've got many other git repos in other subdirs (eg $HOME/projects/repo_1 and so on), which shouldn't be tracked, since they already are. I have found git-...
Francesco's user avatar
  • 684
8 votes
1 answer
3k views

Encrypt files before sending them to Cloud

Recently I switched to GIT along and picked bitbucket to host my code. Now with all the snowden scandal, I decided to review my choices. I really don't want to host my data on my own server, I'd ...
TheDude's user avatar
  • 219
7 votes
8 answers
2k views

Git Client for OS X & Windows? [closed]

Does anybody know of a stable release of a GUI Git Client? Preferrably one that can run on both Mac OS X & Windows..... Heard about SmartGit but it's still in Beta and i'm not sure I have time ...
Goober's user avatar
  • 351
6 votes
8 answers
9k views

Setting up SSH/Git on Cygwin yields "Bad permissions on ~/.ssh/config"

I'm attempting to setup Git with OpenSSH under Cygwin. I almost got everything setup. I have the agent and public key and all that.. but now I get this really weird error: $ git pull -u origin master ...
Earlz's user avatar
  • 4,494
3 votes
1 answer
2k views

Diff to HEAD with PHP Storm?

How can you see a Git diff to HEAD with PHP Storm? I'm trying to switch over to PHP Storm from NetBeans as I've heard that it's more powerful. But I can't see how to use the Git diff tool, which was ...
Evanss's user avatar
  • 1,268
2 votes
2 answers
20k views

How to exit VIM and get back to 'normal' terminal?

I did find this answer here: Vim Stuck In Insert Mode However none of the commands listed worked for me. Exit, cntrl + [, cntrl + q I'm totally a terminal newb, trying to learn how to setup git ...
Leon Gaban's user avatar
  • 2,585
1 vote
1 answer
128 views

Website updating from git (over ssh)

I have a script that I run over SSH, which updates my website from a Git repo. cd website-git git checkout master git pull # Update protected directory rsync -v -a --delete --exclude=db --exclude=...
MightyPork's user avatar
1 vote
2 answers
463 views

Why don't applications update by calculating difference?

I have Ubuntu computers and an Android phone, and it's always perplexed me why the default update manager on Ubuntu and Google Play on the phone don't update existing versions of applications by ...
WeNeigh's user avatar
  • 133
1 vote
1 answer
526 views

How to build a custom command with options

I want to make a command on my Mac to do the following: git add . git commit -m CUSTOM_COMMEND_BY_COMMAND git push cap deploy I seem to be calling those very often. I was wondering what's the best ...
Tam's user avatar
  • 243
218 votes
5 answers
188k views

Git - List all files currently under source control?

Is there a way to list all files currently under source control in git? (Not just those that have been modified).
Anonymous's user avatar
  • 2,611
183 votes
13 answers
272k views

How do I ensure Git doesn't ask me for my GitHub username and password?

I am working with a repo on GitHub and everytime I try to push something, it asks for my GitHub username and password. I don't want it doing that. I tried the instructions on setting your email in ...
picardo's user avatar
  • 2,577
97 votes
6 answers
145k views

How to make git not prompt for passphrase for ssh key?

I'm using git bash and I setup ssh key using ssh-keygen and each time I do something with a repo git ask me for passphrase for /c/Users/jankiewj/.ssh/id_rsa. Is there a way to disable that passphrase. ...
jcubic's user avatar
  • 2,963
78 votes
6 answers
84k views

How to ignore a tracked file in git without deleting it?

My team uses sourcetree as our git client. There is a third-party plugin in our project. It needs several configuration files. These files cannot be generated automatically. They store account name, ...
Liz's user avatar
  • 881
60 votes
1 answer
231k views

How can I merge two branches without losing any files?

I have two branches with the following files in there: branch a: file_a file_b file_c branch b: file_a file_d file_e I want to merge them, so that I get both files from a and b (and files that ...
reox's user avatar
  • 995
59 votes
5 answers
33k views

Setting up an encrypted git-repository

Situation Hi, I would like to save data with git, encrypted (on some platform like bitbucket or github). Therefore the question: Question I am looking for different hassle-free ways on: How to set ...
BadAtLaTeX's user avatar
56 votes
4 answers
55k views

How do you install git-filter-repo?

I'm attempting to use git-filter-repo to remove large binaries from my repository. I have not used python before. I installed the latest python by clicking on the downloaded .exe file as that is a ...
CBFT's user avatar
  • 773
54 votes
7 answers
29k views

How can I enable colored output for OSX diff?

I need to diff two files (not two versions of the same file, they are however tracked by git, but that is unrelated) and I would like some colored output, how can I achieve that? $ diff file_1 file_2 ...
miphe's user avatar
  • 1,019
53 votes
5 answers
27k views

Does Git delete empty folders?

I deleted all files from a directory in my work folder, but the directory itself still exists. After pushing the changes to a remote repository (GitHub) I checked my project and noticed that the ...
vitaliy4us's user avatar
50 votes
4 answers
9k views

Cache the password if SSH-keys are forbidden

I have a server which I have to access frequently via ssh, because I compute on it. Now, the computing center explicitly forbids SSH-keys because they are "insecure". They feel that typing my password,...
user2667180's user avatar
48 votes
4 answers
97k views

Git: How to delete all untracked files?

I'm using Git for version control. Now I want to delete on my local machine all files in the repository that are not tracked. I can use git status to list these files, but how can I delete all of ...
RoflcoptrException's user avatar
47 votes
5 answers
20k views

Mark file as “uncommitable” with Git

I want to show off some of my work by uploading them to my GitHub account. However, there are some files that contain passwords, like database connections. Is there a way of marking a file as ...
Adam Carter's user avatar
44 votes
4 answers
20k views

Tmux and ZSH custom prompt : bug with window name

I have customized my ZSH prompt with oh-my-zsh to make it more readable and add information about git if I'm in a repository. Example : bob@inf [~/docs] % bob@inf [~/src/nicest] master % (in a git ...
Adrien Coquio's user avatar
42 votes
6 answers
22k views

Can you specify git-shell in .ssh/authorized_keys to restrict access to only git commands via ssh?

I'd like to be able to use a ssh key for authentication, but still restrict the commands that can be executed over the ssh tunnel. With Subversion, I've achieved this by using a .ssh/authorized_keys ...
Matt Connolly's user avatar
38 votes
3 answers
16k views

How to disable the git pager but just for certain commands?

I like having the pager enabled for git log for example, but not git diff because I have my own visual diff tool that comes up, and I hate having to hit 'q' at the command line after the diff is done ...
CaptSaltyJack's user avatar
37 votes
2 answers
9k views

How do i get the git pager to clean up screen output after exit?

The pager less doesn't clear the screen as it should do when i use git. I use less all the time and it usually doesn't leave output in the terminal after quit but when less gets executed via git it ...
ggustafsson's user avatar
  • 2,004
36 votes
4 answers
16k views

Rewrite git history to replace all CRLF to LF?

I'm going to transfer a private Git repository from win32 box to Ubuntu. Though I can do a final dos2unix commit, but I'd like to rewrite the whole history, so some Git GUI will display log/diff ...
Lenik's user avatar
  • 18.3k
31 votes
5 answers
46k views

What does the git error message "Server does not allow request for unadvertised object" mean?

I am trying to do a checkout from github, and I got this error message: [user@arch ~]$ git clone --recursive https://github.com/simsong/tcpflow.git Cloning into 'tcpflow'... The authenticity of host '...
vy32's user avatar
  • 3,381
27 votes
4 answers
26k views

Why does git complain that no GPG agent is running?

I have the gpg-agent.exe running, but when I try to git commit, it complains that the GPG agent can not be found: $ gpg-agent --daemon gpg-agent[17440]: a gpg-agent is already running - not starting ...
Oliver Salzburg's user avatar
25 votes
5 answers
55k views

Git For Windows Silent Install Silent Arguments

I'm aware of the basic silent install arguments like so. Git-1.9.4-preview20140611.exe /SILENT /COMPONENTS="icons,ext\reg\shellhere,assoc,assoc_sh" However I need to install git with the option '...
Travis Boatman's user avatar
23 votes
3 answers
23k views

Checkout Git files to a location outside the repository

Is it possible to “checkout” to a location outside of the repository? What I mean is a clone of a branch without the “.git” directory. For example: Use git to manage a website. You edit some files, ...
user240826's user avatar
20 votes
2 answers
45k views

git pull does nothing / git push just hangs / debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

I had an issue in ubuntu 13.10 and 12.10 where attempting to connect to github (git clone / pull / push or anything) would fail with no output. I checked my /.ssh directory for config and any ssh ...
Jason's user avatar
  • 1,899
20 votes
4 answers
58k views

I can't uninstall Git

I was researching Git so I downloaded the Windows version to test it out on a repository on GitHub. After about 30 minutes I couldn't work out how to use it, so I decided I probably wouldn't need a ...
user avatar
18 votes
2 answers
26k views

How can I limit the size of the Android source I need to download with "repo sync"?

I'm planning to leave for a country with a poor Internet connection, where I hope to do some software development. I have been using repo sync to sync the Android source (and the CyanogenMod source ...
Chris's user avatar
  • 323
16 votes
7 answers
14k views

Using git through cygwin on windows 8

I've got a windows 8 dev preview (not sure if it's relevant, but I never had this hassle on w7) machine and I'm trying to clone a git repo from github. The problem is that my ~/.ssh/id_rsa has 440 ...
9point6's user avatar
  • 437