Skip to main content

Posts

Showing posts from October 8, 2017

Git --CheetSheet=4

Interactive Rebase : 1. git rebase -i HEAD~4  #Interactive rebase to edit last 4 commits 2. Plot : You notice a critical error on your part. The commit where you wrote tests comes after the commit where you made the actual changes. Let's swap these 2 commits so that it looks like you wrote the tests first. Swap the 'Add tests' commit so that it comes before the 'Implement poodles' commit. pick b3f1649 Add unicorn pick 4b65a5a Add tests pick f239187 Implement poodles pick c3f863f Added a title to the homepage 3.Plot : As you're editing your commits, you notice that the commit that says 'Add tests' is a little vague, maybe you should change it to something more specific. Use the reword command to change the message of this commit. pick b3f1649 Add unicorn reword 4b65a5a Add tests to commit pick f239187 Implement poodles pick c3f863f Added a title to the homepage 4.Plot : You remember that the 'Add unicorn' commit also contai

Git --CheetSheet 2

Cloning and Branching : 1. git clone git@example.com/exmaple/petshop.git 2. git remote - show # verbose list of remote connections 3. git branch grooming # create a branch name "grooming" 4. git checkout grooming #switch to branch "grooming" #say some work was done on branch "grooming" #next merge to master 5. git checkout master # switch to master branch 6. git merge grooming # merge the changes of grooming into master 7. git checkout -b octopus #branch named "octopus" is created and checked out. 8. git remote update origin --prune #local branches will be updated. 9. You can check them out as local branches with: git checkout -b LocalName origin/remotebranchname Collaboration Basics : 1. git push -u origin hamsters #push the change to remote brach "hamsters" 2. git fetch # retrieve remote brach 3. git branch -d weasel # delete local brach 4. git push -u origin :weasel #delete the brach remotely. 5. git

Git --CheetSheet=3

Rebase Plot:   There is brach named "kennel", this needs to be merged on to master without merge conflicts. So go to branch "kennel" and rebase "master" on it. Then go to "master" and merge "kennel" into "master". Strategy : 1.git checkout kennel 2.git rebase master 3.git checkout master ________________________________________________________________________________ For no merge conflicts : 1. git fetch #retrieve changes from remote without merging into current branch. 2. git rebase #put the fetched remote commits beneath the present commits. 4.git merge kennel _______________________________________________________________________________ History 1. git log --pretty=oneline 2. git diff 3. git diff master elephant #compare one brachn with another. 4. git diff HEAD~2 HEAD 5. git log -p 6. git blame <file_name> ____________________________________________________________________________

Git --CheetSheet=1

1. git help config #shows the usage details of "config" 2. git config --global user.name "yeshsurya"    #add name to configuration 3. git init  #initialize the git repository 4. git status #get the staus of the git repository 5. git add *.html  #add the files using wild card 6. git commit -m "First commit" # make a commit 7. git add css #all the files in directory "css" is added to staging. 8. git log # shows the commit history. 9. git diff HEAD  #difference of the top most commit 10.git diff --staged  #difference of the staged commit 11.git reset ostrich.html #unstage the staged changes 12.git commit -a -m "the commit message" index.html #stage and commit in a single line. 13.git commit --ament -m "will be added to the second commit" #amends last commit by addding files in the staging 14.git reset --soft HEAD^  #undoes the last commit and puts the changes back to stagin

Changing Icon of a Cocoa Application

1. Get to the taget that is being created   1.a. Click on the root of the project file.This should show up list to tagets available.   1.b. Select the target for which you got to change the icon file 2.Click on "info" tab. 3.Put the name of the icon file in the project file.ICNS file should be listed in the file. 4.Add the icns file in the project "Copy bundle files" section of "Build Phases".