

head is currently pointing at) MIXED RESET git/refs/heads/master (to see what SHA nr. of the commit you want to go back to’īasically take the HEAD pointer from one commit to an other commit but not committing the change.Ĭat. It is good idea to copy paste the last couple of commits from log in to a text file to refer back to when doing resets. It left our staging index and our working directory alone.) The soft reset moves the HEAD pointer but don't do anything else. You can pass in the ‘-in’ option with revert, and then it won't actually do the commit, it will just stage it and then wait for you to actually do the commit yourself. This will commit the reverted changes straight away. Git revert ‘S-H-A number of the commit you want to take it from’ This puts it in the stage area, do a commit to keep changes) REVERING ALL TO A PREVIOUS COMMIT (S-H-A number is the unique ‘commit nr’ for each commit found in the git log. Git checkout ‘S-H-A number of the commit you want to take it from’ – ‘filename’ This will amend to last commit, and not create a new log entry.) RETRIVING A PREVIOUS VERSION OF FILE Reverts back to edit last commit, add changes or edit commit message. Good when assembling files for a commit and need to remove one file that don't belongs to current commit. Will blow away the local version and restore what is in the repository – tells that we are not checking out an new branch just a file just in case we have a branch with same name. Shows what has happened to that file since the commit and what changes. Shows what has happened to that file since the commit. Search for any commits that contains Inint in the commit message.ĭisplay short version of S-H-A and commit message in one line.

Show changes between repository version and files that are staged. Show changes between repository version and local version. MOVE FILESĬan be re-named at the same time if name is changed. If file name changed in browser, it shows up as 2 files (delete and untracked) do an add and in stages it knows it is a rename (data 50% the same) Make commits that are related otherwise split them up in separate commits! REMOVE Does not include rename and deleted files. ADDĪdd folder and everything inside of it. Gives a status of project, changes, and untracked files. It would look something like this:Īnd when we merge git will move the head pointer of the master to the head pointer for the origin/master. Sometimes however, you might want to wait with the merge but keep your origin master in sync with the remote repository.īut in reality the origin/master and master are not duplicates they are actually the same but with different head pointers. Git pull include both git fetch and git merge in one handy short cut. We have to do a git merge for these changes get stored in out master branch. When we do a git fetch all the changes get copied in the origin/master branch but not merger in to our master branch Think of it as origin/master is a separate branch form you master branch. Git commit -m ” descriptive commit message here” Git push -u origin master (pushing master to origin -u upstream ) Git remote add origin (links to the remote repro.) Remote repositories works exactly like a branch, it just stores them in a on a remote server.Ĭreate repository on git hub and copy the link. No more then 50 characters, MUST be specific of what has been change! Shows all the settings in the config file that just have been setĬreate folder in desired location and in that folder: Git config –global core.editor “nameOfTextEditor -wl1”

Git config –global user.email config –global credential.helper osxkeychain
