pull from the remote 'origin', but did not specify a branch. Because this is not the default configured remote for your current branch, you must specify a branch on the command line.
pull from the remote 'origin', but did not specify a branch. Because this is not the default configured remote for your current branch, you must specify a branch on the command line. path/to/file: needs update update-index --refresh: command returned error: 1
pull from the remote 'origin', but did not specify a branch. Because this is not the default configured remote for your current branch, you must specify a branch on the command line. path/to/file: needs update update-index --refresh: command returned error: 1 fatal: /usr/local/libexec/git-core/git-pull cannot be used without a working tree.
name master^ “the parent of master” master^2 “the other parent of master” master^^^ master~3 “the parent of the parent of the parent of master” master@{yesterday} “what master was yesterday” master@{5} “what master was five changes ago”
master # # Initial commit # nothing to commit (create/copy files and use "git add" to track) code puls $ “Show me what has happened since the last commit.”
'cube'... remote: Counting objects: 510, done. remote: Compressing objects: 100% (250/250), done. remote: Total 510 (delta 263), reused 433 (delta 204) Receiving objects: 100% (510/510), 561.75 KiB | 507 KiB/s, done. Resolving deltas: 100% (263/263), done. code puls $ “Start by making me a copy of that other repository over there so I can work on it.”
code puls $ git add README code puls $ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm -‐-‐cached <file>..." to unstage) # # new file: README # code puls $ “Stage these files for the next commit that I’m about to create.”
code puls $ git add README code puls $ git commit -‐m "Initial commit" [master (root-‐commit) 3b29c5f] Initial commit 1 file changed, 1 insertion(+) create mode 100644 README code puls $ “Take the stuff I just staged and turn it in to a recorded snapshot. Also update the HEAD and ‘current branch’ references.”
2b8e22274b49967079bc1948af7af1cfd37f2827 Second commit * 3b29c5fae191058bdd612ff932543caa7dbf00c6 Initial commit code puls $ “Show me the list of commits.”
the beginning Hello World Goodbye World code puls $ git checkout two && cat README Switched to branch 'two' Hello World Goodbye World Line at the end code puls $ git checkout master && git merge two Switched to branch 'master' Auto-‐merging README Merge made by the 'recursive' strategy. README | 1 + 1 file changed, 1 insertion(+) code puls $ “Make a new commit that reflects all of the changes in two different commit histories.”
the beginning Hello World Goodbye World code puls $ git checkout two && cat README Switched to branch 'two' Hello World Goodbye World Line at the end code puls $ git checkout master && git merge two Switched to branch 'master' Auto-‐merging README Merge made by the 'recursive' strategy. README | 1 + 1 file changed, 1 insertion(+) code puls $ “Make a new commit that reflects all of the changes in two different commit histories.” code puls $ cat README Line at the beginning Hello World Goodbye World Line at the end code puls $
> git://github.com/puls/somecode.git code puls $ git remote -‐v origin git://github.com/puls/somecode.git (fetch) origin git://github.com/puls/somecode.git (push) code puls $ “Add or remove a named shorthand for a remote copy of this repository.”
objects: 15, done. Delta compression using up to 8 threads. Compressing objects: 100% (6/6), done. Writing objects: 100% (15/15), 1.18 KiB, done. Total 15 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (15/15), done. To git://github.com/puls/somecode.git * [new branch] master -‐> master code puls $ “Send a particular reference and all of the objects it points at over to that repository .”
Revert "Add a line at the end" 1 file changed, 1 deletion(-‐) code puls $ git log -‐-‐pretty=oneline d16efa92e46f00a768617883f7f63e24c41e4001 Revert "Add a line at the 24e05021800f8ddc85000ba0f29fad8de902ca42 Merge branch 'two' d0fcd3b4abeda5de3c36a335e29e32438a7d6b8e Add a line at the end d6d415e2ecae33233684e2b2b94898633e0af9f6 Add a line at the beginning code puls $ “Make a new commit that undoes this previous commit.”
Add a line at the end 1 file changed, 1 insertion(+) code puls $ git log -‐-‐graph -‐-‐all -‐-‐pretty=oneline -‐-‐decorate * 74136827f00e432d3e8008da70d8106c44548886 (HEAD, master) Add a li * d6d415e2ecae33233684e2b2b94898633e0af9f6 Add a line at the begin | * d0fcd3b4abeda5de3c36a335e29e32438a7d6b8e (two) Add a line at t |/ * 2b8e22274b49967079bc1948af7af1cfd37f2827 Second commit code puls $ “Apply the change created by one commit on that branch to this branch.”
diff -‐-‐git a/README b/README index 84fd02a..71acfe7 100644 -‐-‐-‐ a/README +++ b/README @@ -‐1,3 +1,4 @@ +Another at the beginning Line at the beginning Hello World Goodbye World Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? “Stage just certain parts of these files for the next commit.”
-‐-‐decorate * d0fcd3b4abeda5de3c36a335e29e32438a7d6b8e (two) Add a line at the | * d6d415e2ecae33233684e2b2b94898633e0af9f6 (HEAD, master) Add a l |/ * 2b8e22274b49967079bc1948af7af1cfd37f2827 Second commit code puls $ git rebase two First, rewinding head to replay your work on top of it... Applying: Add a line at the beginning code puls $ git log -‐-‐all -‐-‐graph -‐-‐pretty=oneline -‐-‐decorate * 8841ea153758ca5933e79d40e8ce2651541fe094 (HEAD, master) Add a lin * d0fcd3b4abeda5de3c36a335e29e32438a7d6b8e (two) Add a line at the * 2b8e22274b49967079bc1948af7af1cfd37f2827 Second commit “Instead of merging, apply each change I’ve made as a patch over that version.”
-‐-‐pretty=oneline -‐-‐decorate * d0fcd3b4abeda5de3c36a335e29e32438a7d6b8e (two) Add a line at the | * d6d415e2ecae33233684e2b2b94898633e0af9f6 (HEAD, master) Add a l |/ * 2b8e22274b49967079bc1948af7af1cfd37f2827 Second commit code puls $ git rebase two First, rewinding head to replay your work on top of it... Applying: Add a line at the beginning code puls $ git log -‐-‐all -‐-‐graph -‐-‐pretty=oneline -‐-‐decorate * 8841ea153758ca5933e79d40e8ce2651541fe094 (HEAD, master) Add a lin * d0fcd3b4abeda5de3c36a335e29e32438a7d6b8e (two) Add a line at the * 2b8e22274b49967079bc1948af7af1cfd37f2827 Second commit “Let me edit history, rearranging, changing, and combining commits.”
$ git bisect bad code puls $ git checkout 2b8e22274b49967079bc1948af7af1cfd37f2827 Note: checking out '2b8e22274b49967079bc1948af7af1cfd37f2827'. HEAD is now at 2b8e222... Second commit code puls $ git bisect good Bisecting: 0 revisions left to test after this (roughly 0 steps) [d0fcd3b4abeda5de3c36a335e29e32438a7d6b8e] Add a line at the end code puls $ git bisect good 8841ea153758ca5933e79d40e8ce2651541fe094 is the first bad commit code puls $ git bisect reset Switched to branch 'master' code puls $ “Something is broken. Since I know when it worked, do a binary search to figure out which change broke it.”
[-‐-‐man-‐ path] [-‐-‐info-‐path] [-‐p|-‐-‐paginate|-‐-‐no-‐pager] [-‐-‐no-‐replace-‐ objects] [-‐-‐bare] [-‐-‐git-‐dir=<path>] [-‐-‐work-‐tree=<path>] [-‐-‐ namespace=<name>] [-‐c name=value] [-‐-‐help] <command> [<args>] The most commonly used git commands are: add Add file contents to the index bisect Find by binary search the change that introduced a bu branch List, create, or delete branches checkout Checkout a branch or paths to the working tree clone Clone a repository into a new directory commit Record changes to the repository diff Show changes between commits, commit and working tree fetch Download objects and refs from another repository grep Print lines matching a pattern init Create an empty git repository or reinitialize an exi log Show commit logs merge Join two or more development histories together mv Move or rename a file, a directory, or a symlink pull Fetch from and merge with another repository or a loc push Update remote refs along with associated objects rebase Forward-‐port local commits to the updated upstream he reset Reset current HEAD to the specified state rm Remove files from the working tree and from the index
Add file contents to the index bisect Find by binary search the change that introduced a bu branch List, create, or delete branches checkout Checkout a branch or paths to the working tree clone Clone a repository into a new directory commit Record changes to the repository diff Show changes between commits, commit and working tree fetch Download objects and refs from another repository grep Print lines matching a pattern init Create an empty git repository or reinitialize an exi log Show commit logs merge Join two or more development histories together mv Move or rename a file, a directory, or a symlink pull Fetch from and merge with another repository or a loc push Update remote refs along with associated objects rebase Forward-‐port local commits to the updated upstream he reset Reset current HEAD to the specified state rm Remove files from the working tree and from the index show Show various types of objects status Show the working tree status tag Create, list, delete or verify a tag object signed wi See 'git help <command>' for more information on a specific command.