In Git, what is the difference between origin/master vs origin master?

I know, origin is a term for the remote repository and master is the branch there. I am purposely omitting the “context” here and I am hoping that the answer should not depend upon the context. So in git command lines, what is the difference between origin/master and origin master. Is there a non-ambiguous way […]

Git: list only “untracked” files (also, custom commands)

Is there a way to use a command like git ls-files to show only untracked files? The reason I’m asking is because I use the following command to process all deleted files: git ls-files -d | xargs git rm I’d like something similar for untracked files: git some-command –some-options | xargs git add I was […]

Can Git really track the movement of a single function from 1 file to another? If so, how?

Several times, I have come across the statement that, if you move a single function from one file to another file, Git can track it. For example, this entry says, “Linus says that if you move a function from one file to another, Git will tell you the history of that single function across the […]

How to preview git-pull without doing fetch?

Is it even possible? Basically, there’s a remote repository from which I pull using just: git pull Now, I’d like to preview what this pull would change (a diff) without touching anything on my side. The reason is that thing I’m pulling might not be “good” and I want someone else to fix it before […]

Modified files in a git branch are spilling over into another branch

I am working on a git repository with a master branch and another topic branch. I have switched to topic branch and modified a file. Now, if I switched to master branch that same file is shown as modified. For example: git status in git-build branch: # On branch git-build # Changes to be committed: […]

Listing each branch and its last revision's date in git

I need to delete old and unmaintained branches from our remote repo. I’m trying to find a way with which to list the remote branches by their last modified date, and I can’t. Does someone know of an easy way to list remote branches this way?

How to work with multiple ssh keys

This question already has an answer here: Multiple GitHub Accounts & SSH Config 9 answers

Git slows down Emacs to Death – How to Fix this?

Opening a file (either by typing Ctrl-x f, AKA Find File) or by typing f on that file in Dired mode), is painfully slow in working directories that have a .git subdirectory. Even the simplest file (50 lines with mostly comments) could take up to 8 seconds to open. The same file, in a different […]

Git push error: “origin does not appear to be a git repository”

I am following the instructions given here to create a Git repository. All went well until the last line: $ git push -u origin master fatal: ‘origin’ does not appear to be a git repository fatal: The remote end hung up unexpectedly I’m using git version on OS X 10.6.8 $ git remote -v […]

git – how to remove git tracking from a project?

I want to remove git tracking from a project’s directory. What is the correct method to do this? Can I do a shell command such as: rm -rf .git from my projects directory or is there a way to do this as a git command. I used this project to learn git and realize I […]

Git Baby is a git and github fan, let's start git clone.