-
-
Notifications
You must be signed in to change notification settings - Fork 2
Git tips and tricks
This page is a place to collect things we found out how to do in git
- Open git bash window
- git stash
- Usual process to create feature branch...checkout develop, rebase, start feature
- git stash pop
Usually your changes are there. If someone else modified the same files you will need to merge.
Todo: describe that process.
This is helpful if some non-flex repo is using git/gerrit, but the add-ons for git gui are not available.
You just realized that you committed your changes to develop instead of a feature branch...
git log
Will produce something like
commit 72265073df3c23f860a27b076cf5b085c5a82aef
Author: John Thomson <[email protected]>
Date: Tue Aug 27 10:44:00 2013 -0500
LT-14852 Shorten keyboard control labels
You need to copy the SHA code (from the commit line above).
git branch feature/LT-14852
(Makes your feature branch...give it your own name, of course)
git rebase -p --onto feature/LT-14852 72265073df3c23f860a27b076cf5b085c5a82aef^ develop
(Replace feature/LT-14852 with the name of your feature, 72265073df3c23f860a27b076cf5b085c5a82aef with your SHA, and develop with the name of the branch you accidentally committed to...often develop will be right. Keep the "^" character at the end of the SHA.)
git checkout feature/LT-14852
At this point you can go into git gui and amend last commit and make sure everything is right.