CS175
Chris Pollett
Sep 22, 2014
git format-patch rev1 rev2
git format-patch e3e4f2067 --stdout > my.patchHere no rev2 is given so it will be assumed to be HEAD.
% git apply --stat my.patch test1.php | 2 ++ test2.php | 2 ++ test1.php | 1 + test2.php | 2 -- 4 files changed, 5 insertions(+), 2 deletions(-)
git apply --check my.patch
git am --signoff < my.patch
git tag -a tag_name revision -m "message about creating tag"For example, in our myrepos example, we might make some changes and commit and the commit has version number. We could make a v1 tag as follows:
git tag -a v1 c3ac05c -m "Made Version 1"
git fetch --tagsIn our case, we could cd into myrepos2 and then type this line.
cd ../myrepos2 git pull git fetch --tags
git checkout tags/[tag_name]In our example, in myrepos2, we could type:
git checkout tags/v1
Which of the following is true?
git config --global user.name "YOUR NAME" git config --global user.email "YOUR EMAIL ADDRESS"
https://github.com/ORIGINAL_USERNAME/PROJECT.gityour fork wil be
https://github.com/YOUR_USERNAME/PROJECT.git
git clone https://github.com/YOUR_USERNAME/PROJECT.git
git remote add upstream https://github.com/ORIGINAL_USERNAME/PROJECT.git
git push origin masterto send them back to GitHub in our workspace on GitHub.
git fetch upstreamthen check out our local branch
git checkout masterand finally merge changes (we might need to resolve conflicts like described earlier)
git merge upstream/master
This actually looks ugly, because we have our storyboard set up with the width and height both set to Any.
If we want our storyboard more like a older iPhone we can adjust these kind of values to compact and play with Layout.
// // ViewController.h // KeyboardTest // // Created by Chris Pollett on 9/22/14. // Copyright (c) 2014 Chris Pollett. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UITextField *nameField; @property (weak, nonatomic) IBOutlet UITextField *numberField; @end
// // ViewController.m // KeyboardTest // // Created by Chris Pollett on 9/22/14. // Copyright (c) 2014 Chris Pollett. All rights reserved. // #import "ViewController.h" @interface ViewController () @end @implementation ViewController -(IBAction)textFieldDoneEditing:(id)sender { [sender resignFirstResponder]; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end
-(IBAction)backgroundClick:(id)sender;to our header file.
-(IBAction)backgroundClick:(id)sender { [_nameField resignFirstResponder]; [_numberField resignFirstResponder]; }