view page source - page history - about editing

Revision History: Git

This is revision 347 of the page Git, as it appeared on Sun, 02 Feb 2014 17:25:29 -0800.
  1. Synchronising SVN and Git

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!

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
Categories: Git | Subversion

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