Git merge with conflicts – which line was committed later

When a conflict arises during a git merge, I sometimes wonder which line is the correct one (which one was modified the last). Example: <<<<<<< HEAD div.some-class ======= div.another-class >>>>>>> commit message that doesn’t give clue which commit to choose #no clue which is good How can I determine which line was modified last? (We […]

How do I setup Ghost EC2 instance with git so I can push changes from my local copy

I followed the instructions for setting up Ghost on EC2. I used the following AMI. It was very simple and my new Ghost site is up and running. I was also able to SSH into the instance just fine. Now I’d like to use git to pull down the site locally to my system and […]

Updating author information on annotated/signed tags in git using filter-branch or a similar tool

Is there a good way to update the author email and name of annotated or signed tags for an entire git repository? For commits, I use git filter-branch with the following script #!/bin/bash if [ “$GIT_AUTHOR_EMAIL” = “” ]; then GIT_AUTHOR_NAME=”My Name”; GIT_AUTHOR_EMAIL=””; git commit-tree “$@”; else git commit-tree “$@”; fi and command git filter-branch […]

How do I get my current build commit's sha1 in Android Studio?

How can I access the current build commit’s sha1 of my project from Java code? This is preferred but not obligatory: Getting the shortened version of sha1 (say, 6 first chars) A solution without any side libraries or frameworks I’m using OS.X v. 10.10, Android Studio v. 1.2.2.

Mirroring git repository with submodules

Suppose that I have a git server with several repos, and that one of the repos includes some of the others as submodules. Is it possible to mirror all of the repositories on another server and redirect the submodule dependencies without altering the history?

GIT how to create patch from non consecutive commits

I have several commits in a branch “feature-1” that are part of some feature (lets call it feature X). In the branch exists also several merges from master, that means that feature X could be spread between other commits. Also imagine that rebase was not used, so we can have something like: J – K […]

problems with git hub local repo –invalid key errors

I have tried to create a local directory and then initialize it (git init) as well as created one on my github account and then clone it using (git remote add origin remote_repository_url) but regardless of what I do, once I try to use any git command while in my local repo, I get the […]

Subtree-split with empty-ident commit; or, deleting a commit without rebase: an unusual use-case

I have a very large repository with one branch. Its working tree is constantly being updated (every few seconds) and committed (every few minutes). My actual goal here is to run git subtree split for a particular directory and truncate most of the repository after moving that directory to a save location. (See Detach (move) […]

How to `git show` on a file that was renamed after specified revision?

I’m looking for a way to show the contents of a file in my repository at some point back in time. I use the following command: $ git show “origin/master@{1 year ago}:A/B/C/main.h” However, 1 year ago ‘main.h’ existed at X/Y/Z/main.h. So, if I adjust to this instead: $ git show “origin/master@{1 year ago}:X/Y/Z/main.h” This shows […]

After git push or merge, how to update multiple remotes?

This is probably a git hook question, and a little bit of git workflow, how things should be done. This is what we are doing now: Developers have their local repos (prod, dev, test) of application in development, after changes on code and proper testing, they push or merge to central repo which is gitlab […]

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