tagged [git]

What is the difference between merge --squash and rebase?

What is the difference between merge --squash and rebase? I'm trying to understand the difference between a squash and a rebase. As I understand it, one performs a squash when doing a rebase.

29 Dec at 00:28

How can I view the Git history in Visual Studio Code?

How can I view the Git history in Visual Studio Code? I can execute various Git commands from Visual Studio Code, however I couldn't find a way to visualize the history.

How to read the output from git diff?

How to read the output from git diff? The man page for `git-diff` is rather long, and explains many cases which don't seem to be necessary for a beginner. For example:

1 Sep at 05:6

Difference between "git add -A" and "git add ."

Difference between "git add -A" and "git add ." What is the difference between [git add [--all | -A]](https://git-scm.com/docs/git-add#Documentation/git-add.txt--A) and [git add .](https://git-scm.com...

10 Jul at 22:26

How do I modify a specific commit?

How do I modify a specific commit? I have the following commit history: 1. HEAD 2. HEAD~ 3. HEAD~2 4. HEAD~3 `git commit --amend` modifies the current `HEAD` commit. But how do I modify `HEAD~3`?

11 Jul at 06:50

git pull error :error: remote ref is at but expected

git pull error :error: remote ref is at but expected

30 Jul at 07:49

Git clone without .git directory

Git clone without .git directory Is there a flag to pass to `git` when doing a clone, say don't clone the `.git` directory? If not, how about a flag to delete the `.git` directory after the clone?

13 May at 23:31

How do I run git log to see changes only for a specific branch?

How do I run git log to see changes only for a specific branch? I have a local branch tracking the remote/master branch. After running `git-pull` and `git-log`, the log will show all commits in the re...

24 Jul at 11:34

How to list only the names of files that changed between two commits

How to list only the names of files that changed between two commits I have a bunch of commits in the repository. I want to see a list of files changed between two commits - from to . What command sho...

26 Aug at 16:55

Undo git update-index --assume-unchanged <file>

Undo git update-index --assume-unchanged I have run the following command to ignore watching/tracking a particular directory/file: How can I undo this, so that `` is watched/tracked again?

10 Mar at 19:29

Set an environment variable in git bash

Set an environment variable in git bash When I punch from the windows gitbash command line: and do : It does not set it to `c`? How can I change/set the value of an environment variable?

9 Dec at 05:12

GitHub - fatal: could not read Username for 'https://github.com': No such file or directory

GitHub - fatal: could not read Username for 'https://github.com': No such file or directory I have the following problem when I try to pull code using git Bash on Windows: I already tried to implement...

1 Sep at 09:4

What's the difference between git switch and git checkout <branch>

What's the difference between git switch and git checkout Git 2.23 [introduces](https://github.com/git/git/blob/master/Documentation/RelNotes/2.23.0.txt) a new command `git switch` -- after reading th...

12 Oct at 06:41

Is there a command to undo git init?

Is there a command to undo git init? I just Git init'ed a repos with a wrong user, and want to undo it. Is there any command for this? Do I actually have to go in and edit the .git directory?

13 Sep at 22:43

Why doesn't Git ignore my specified file?

Why doesn't Git ignore my specified file? I added the following line to `.gitignore`: but when I type `git status` it shows the file as unstaged file. What's the problem? All other patterns work well.

27 Oct at 14:57

Can I make 'git diff' only display the line numbers AND changed file names?

Can I make 'git diff' only display the line numbers AND changed file names? [see this question and answer](https://stackoverflow.com/q/1552340/124486) --- Basically, I don't want to see the changed co...

14 Jun at 11:41

Push commits to another branch

Push commits to another branch Is it possible to commit and push changes from one branch to another. Assume I commited changes in and want to push them to . From , is it valid to do: And then reset BR...

7 Jul at 12:29

git submodule tracking latest

git submodule tracking latest We are moving our (huge) project to git and we are thinking about using submodules. Our plan is to have three different heads in the superproject: > release, stable, late...

30 May at 08:29

Ignore files that have already been committed to a Git repository

Ignore files that have already been committed to a Git repository I have an already initialized Git repository that I added a `.gitignore` file to. How can I refresh the file index so the files I want...

How to fix committing to the wrong Git branch?

How to fix committing to the wrong Git branch? I just made a perfectly good commit to the wrong branch. How do I undo the last commit in my master branch and then take those same changes and get them ...

18 Jul at 07:12

What is difference between 'git reset --hard HEAD~1' and 'git reset --soft HEAD~1'?

What is difference between 'git reset --hard HEAD~1' and 'git reset --soft HEAD~1'? I tried to undo my commit in git. Is it dangerous to use `git reset --hard HEAD~1`? What is the difference between d...

22 Feb at 01:8

How do I undo 'git add' before commit?

How do I undo 'git add' before commit? I mistakenly added files to Git using the command: I have not yet run `git commit`. How do I undo this so that these changes will not be included in the commit?

25 Jul at 02:7

How do I update or sync a forked repository on GitHub?

How do I update or sync a forked repository on GitHub? I forked a project, made changes, and created a pull request which was accepted. New commits were later added to the repository. How do I get tho...

Adding Only Untracked Files

Adding Only Untracked Files One of the commands I find incredibly useful in Git is `git add -u` to throw everything but untracked files into the index. Is there an inverse of that? Such as a way to ad...

9 Jun at 18:50

Why does git say "Pull is not possible because you have unmerged files"?

Why does git say "Pull is not possible because you have unmerged files"? When I try to pull in my project directory in the terminal, I see the following error: ``` harsukh@harsukh-desktop:~/Sites/bran...