view page source - page history - about editing

Revision History: Git

This is revision 364 of the page Git, as it appeared on Mon, 24 Feb 2014 21:09:42 -0800.
  1. Synchronising SVN and Git
  2. Configuring Jenkins CI to work with Git on Ubuntu
  3. To check out: Using Git on Windows

Things SVN can do that Git can't

  1. Checkout into a non-empty directory; you have to checkout into a temporary directory, move the .git folder into the non-empty directory, and run a git reset --hard
  2. Add an empty folder. It's impossible in Git! .keep files everywhere!
  3. Store passwords on Windows without having to first install some horrible abomination of Cygwin/credential stores/SSH agents, or having to use the GUI client. (Setup SSH for Git and updating Git to use SSH instead of HTTPS)
  4. Display --help information without opening up a man page or a web document (if using Windows?). The --help flag should only print out a summary of help information to the command line.

Branching


Create a branch:
  1. git branch (new-branch-name) - create a new branch
  2. git push origin (new-branch-name) - ??
  3. git checkout (new-branch-name) - switch to branch and update local copy to branch
  4. git commit -p - commit changes to local Git
  5. git push --set-upstream origin (new-branch-name) - push local Git changes to remote Git
Switching branches:
  1. git checkout master - switch back to master and update local copy to master
  2. git pull - download remote Git to local Git
Merge branch back in:
  1. git checkout master - switch back to master and update local copy to master
  2. git pull origin master - update local Git from remote Git
  3. git merge (new-branch-name) - do the merge from the given branch (I don't know what happens with conflicts!)
  4. git push origin master - push local Git to remote Git
Merge two different branches (e.g. you are working on target and want to merge in branch source):
  1. git checkout (target-branch-name) - switch back to master and update local copy to master
  2. git pull origin (target-branch-name) - update local Git from remote Git
  3. git merge (source-branch-name) - do the merge from the given branch (I don't know what happens with conflicts!)
  4. git push --set-upstream origin (target-branch-name) - push local Git to remote Git

Merging with TortoiseMerge


I really like TortoiseSVN's merge tool, and with a bit of wrangling you can get Git to use it too.

Add the following files to Gitsharegit-guilibmergetool.tcl just before the error_popup [mc "Unsupported merge tool '%s'" $tool] block:

tortoisemerge {
    set cmdline [list TortoiseMerge.exe -base:"$BASE" -mine:"$LOCAL" -theirs:"$REMOTE" -merged:"$MERGED"]
}

And then you can run GUI merges using git mergetool -t tortoisemerge.
Categories: Git | Subversion

view page source - what links to here? - page history - top
Last edited by jevon jevon 57 months ago