Difference between revisions of "Git"

From Vague Hope Wiki
Jump to: navigation, search
Line 16: Line 16:
 
git clean -fd
 
git clean -fd
 
git checkout .
 
git checkout .
 +
</pre>
 +
 +
== Rebase pattern ==
 +
 +
Check out branch we want to (eventually) deliver to.
 +
Double check its all up to date.
 +
<pre>
 +
git checkout desuapp-codefoo
 +
git pull
 +
</pre>
 +
 +
Create new branch and check out.
 +
<pre>
 +
git checkout -b task101
 +
</pre>
 +
 +
( Do actual work, make commits, etc. )
 +
 +
Update local copy of branch we want to deliver to.
 +
<pre>
 +
git fetch origin
 +
</pre>
 +
 +
Do the magic rebase thing - rewrite history and send current target branch back in time.
 +
<pre>
 +
git rebase origin/desuapp-codefoo
 +
</pre>
 +
 +
Switch to the branch we want to deliver to and get it up to date.
 +
<pre>
 +
git checkout desuapp-codefoo
 +
git pull
 +
</pre>
 +
 +
Bring over our work in to the local copy of the delivery target branch.
 +
<pre>
 +
git rebase comment_broken_links_101026
 +
</pre>
 +
 +
Send it out into the big wide world with the happy satisfaction of a job well done.
 +
<pre>
 +
git push
 
</pre>
 
</pre>
  

Revision as of 14:46, 29 August 2011

Commands I keep forgetting

Update workspace (works for github):

git fetch
git merge origin/master

Tags:

git push --tags

Reset working copy:

git clean -fd
git checkout .

Rebase pattern

Check out branch we want to (eventually) deliver to. Double check its all up to date.

git checkout desuapp-codefoo
git pull

Create new branch and check out.

git checkout -b task101

( Do actual work, make commits, etc. )

Update local copy of branch we want to deliver to.

git fetch origin

Do the magic rebase thing - rewrite history and send current target branch back in time.

git rebase origin/desuapp-codefoo

Switch to the branch we want to deliver to and get it up to date.

git checkout desuapp-codefoo
git pull

Bring over our work in to the local copy of the delivery target branch.

git rebase comment_broken_links_101026

Send it out into the big wide world with the happy satisfaction of a job well done.

git push

References

Merg / Rebase

Deploying