tagged [git]

fetch from origin with deleted remote branches?

fetch from origin with deleted remote branches? When I do `git fetch origin` and origin has a deleted branch, it doesn't seem to update it in my repository. When I do `git branch -r` it still shows `o...

14 Jan at 12:21

How do I undo the most recent local commits in Git?

How do I undo the most recent local commits in Git? I accidentally committed the wrong files to [Git](https://en.wikipedia.org/wiki/Git), but didn't push the commit to the server yet. > How do I undo ...

23 Nov at 12:53

How to determine when a Git branch was created?

How to determine when a Git branch was created? Is there a way to determine a Git branch was created? I have a branch in my repo and and I don't remember creating it and thought maybe seeing the creat...

24 Jul at 18:21

Default behavior of "git push" without a branch specified

Default behavior of "git push" without a branch specified I use the following command to push to my remote branch: If I say does that push changes in my other branches too, or does it only update my c...

24 Jun at 04:40

Are Git forks actually Git clones?

Are Git forks actually Git clones? I keep hearing people say they're forking code in Git. Git "fork" sounds suspiciously like Git "clone" plus some (meaningless) psychological willingness to forgo fut...

31 Jan at 14:24

View the change history of a file using Git versioning

View the change history of a file using Git versioning How do I view the history of an individual file with complete details of what has changed? `git log -- [filename]` shows me the commit history of...

10 Jul at 21:49

Get the current git hash in a Python script

Get the current git hash in a Python script I would like to include the current git hash in the output of a Python script (as a the of the code that generated that output). How can I access the curren...

18 Dec at 16:7

Git: Merge a Remote branch locally

Git: Merge a Remote branch locally I've pulled all remote branches via `git fetch --all`. I can see the branch I'd like to merge via `git branch -a` as remotes/origin/branchname. Problem is it is not ...

23 Jul at 11:4

How to diff a commit with its parent

How to diff a commit with its parent Aside from writing an alias or script, is there a shorter command for getting the diff for a particular commit? If you only give the single commit id `git diff 15d...

7 Jul at 17:38

How do I remove the old history from a git repository?

How do I remove the old history from a git repository? I'm afraid I couldn't find anything quite like this particular scenario. I have a git repository with a lot of history: 500+ branches, 500+ tags,...

What's the difference between git clone --mirror and git clone --bare

What's the difference between git clone --mirror and git clone --bare The git clone help page has this to say about `--mirror`: > Set up a mirror of the remote repository. This implies `--bare`. But d...

14 Nov at 04:56

How do I avoid the specification of the username and password at every git push?

How do I avoid the specification of the username and password at every git push? I `git push` my work to a remote Git repository. Every `push` will prompt me to input `username` and `password`. I woul...

28 Apr at 13:38

How do I reset or revert a file to a specific revision?

How do I reset or revert a file to a specific revision? How do I revert a modified file to its previous revision at a specific commit hash (which I determined via [git log](https://git-scm.com/docs/gi...

8 Jul at 04:17

How do I alias commands in git?

How do I alias commands in git? I saw a screencast where someone had gotten to work. When I do it I get an error asking me if I meant something else. Being a git newb, I need to know what you have to...

9 Jun at 11:44

Move branch pointer to different commit without checkout

Move branch pointer to different commit without checkout To move the branch pointer of a checked out branch, one can use the `git reset --hard` command. But how to move the branch pointer of a not-che...

13 Jun at 10:48

How can I get a side-by-side diff when I do "git diff"?

How can I get a side-by-side diff when I do "git diff"? When I type `git diff`, I'd like to see a side-by-side diff, like with `diff -y`, or like to display the diff in an interactive diff tool like `...

6 May at 08:23

What is the difference between origin and upstream on GitHub?

What is the difference between origin and upstream on GitHub? What is the difference between `origin` and `upstream` on [GitHub](http://en.wikipedia.org/wiki/GitHub)? When a `git branch -a` command is...

3 Jul at 22:46

! [rejected] master -> master (fetch first)

! [rejected] master -> master (fetch first) Is there a good way to explain how to resolve "`! [rejected] master -> master (fetch first)'`" in Git? When I use this command `$ git push origin master` it...

10 Feb at 10:51

Download a specific tag with Git

Download a specific tag with Git I'm trying to figure out how I can download a particular tag of a Git repository - it's one version behind the current version. I saw there was a tag for the previous ...

29 Jan at 19:5

Move the most recent commit(s) to a new branch with Git

Move the most recent commit(s) to a new branch with Git How do I move my recent commits on master to a new branch, and reset master to before those commits were made? e.g. From this: To this:

Combining multiple commits before pushing in Git

Combining multiple commits before pushing in Git I have a bunch of commits on my local repository which are thematically similar. I'd like to combine them into a single commit before pushing up to a r...

6 Jun at 08:9

Create patch or diff file from git repository and apply it to another different git repository

Create patch or diff file from git repository and apply it to another different git repository I work on WordPress based project and I want to patch my project at each new release version of WP. For t...

8 Feb at 00:29

Create Git branch with current changes

Create Git branch with current changes I started working on my branch thinking that my task would be easy. After a while I realized it would take more work and I want to do all this work in a new bran...

11 Apr at 11:40

Can I restore deleted files (undo a `git clean -fdx`)?

Can I restore deleted files (undo a `git clean -fdx`)? I was following the instructions on [making github pages](http://pages.github.com/), and forgot to move down into my git sub directory. As a resu...

12 Apr at 10:7

How do I create a master branch in a bare Git repository?

How do I create a master branch in a bare Git repository? (Folder is created with git-ish files and folders inside) (Okay, so I can't use git status with a bare repo; makes sense I guess) (Nothing, it...

3 Aug at 10:24