githug通关部分黏贴(git代码练习)

git基础教程(12) 理解HEAD指针和分支指针 HEAD指针 使用git checkout 来移动HEAD指针,移动的对象可以是分支指针也可以是快照。 HEAD指针可以指向快照也可以指向branch。当指向branch时提交后会和branch指针一起向后移动,当不指向branch提交时则会在一个detached状态。 分支(branch)指针 使用git branch -f 来移动分支指针,移动的对象只能是快照。当且仅当HEAD指针指向分支指针的时候,提交才会有效。 实例 1.HEAD指针默认指向当前的分支指针,用星号表示,如master* 2.移动H 阅读详情

最近发现了githug一个小游戏是帮助学习git的各种命令 玩了几遍 把部分代码贴出来

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Sorry, this solution is not quite right!

 

Name: init

Level: 1

Difficulty: *

 

A new directory, `git_hug`, has been created; initialize an empty repository in it.

 

 

liyachao@ubuntu:~/git_hug$ git init

Initialized empty Git repository in /home/liyachao/git_hug/.git/

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: config

Level: 2

Difficulty: *

 

Set up your git name and email, this is important so that your commits can be identified.

 

 

liyachao@ubuntu:~/git_hug$ git config user.name "liyachao"//自己的名字

liyachao@ubuntu:~/git_hug$ git config user.email "296777513@qq.com"//自己的邮箱

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

What is your name? liyachao

What is your email? 296777513@qq.com

Your config has the following name: liyachao

Your config has the following email: 296777513@qq.com

Congratulations, you have solved the level!

 

Name: add

Level: 3

Difficulty: *

 

There is a file in your folder called `README`, you should add it to your staging area

Note: You start each level with a new repo. Don't look for files from the previous one.

 

 

liyachao@ubuntu:~/git_hug$ ls

README

liyachao@ubuntu:~/git_hug$ git add README 

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: commit

Level: 4

Difficulty: *

 

The `README` file has been added to your staging area, now commit it.

 

 

liyachao@ubuntu:~/git_hug$ git commit -m "first commit"

[master (root-commit) 15de50d] first commit

 1 file changed, 0 insertions(+), 0 deletions(-)

 create mode 100644 README

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: clone

Level: 5

Difficulty: *

 

Clone the repository at https://github.com/Gazler/cloneme.

 

 

liyachao@ubuntu:~/git_hug$ git clone https://github.com/Gazler/cloneme 

Cloning into 'cloneme'...

remote: Counting objects: 7, done.

remote: Total 7 (delta 0), reused 0 (delta 0)

Unpacking objects: 100% (7/7), done.

Checking connectivity... done.

liyachao@ubuntu:~/git_hug$ ls

cloneme

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: clone_to_folder

Level: 6

Difficulty: *

 

Clone the repository at https://github.com/Gazler/cloneme to `my_cloned_repo`.

 

 

liyachao@ubuntu:~/git_hug$ git clone https://github.com/Gazler/cloneme my_cloned_repo

Cloning into 'my_cloned_repo'...

remote: Counting objects: 7, done.

remote: Total 7 (delta 0), reused 0 (delta 0)

Unpacking objects: 100% (7/7), done.

Checking connectivity... done.

liyachao@ubuntu:~/git_hug$ ls

my_cloned_repo

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: ignore

Level: 7

Difficulty: **

 

The text editor 'vim' creates files ending in `.swp` (swap files) for all files that are currently open.  We don't want them creeping into the repository.  Make this repository ignore `.swp` files.

 

 

liyachao@ubuntu:~/git_hug$ vim .gitignore 

*.gitignore

liyachao@ubuntu:~/git_hug$ ls

README.swp

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: include

Level: 8

Difficulty: **

 

Notice a few files with the '.a' extension.  We want git to ignore all but the 'lib.a' file.

 

 

liyachao@ubuntu:~/git_hug$ vim .gitignore 

*.a

!lib.a

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: status

Level: 9

Difficulty: *

 

There are some files in this repository, one of the files is untracked, which file is it?

 

 

liyachao@ubuntu:~/git_hug$ gitstatus

No command 'gitstatus' found, did you mean:

 Command 'gitstats' from package 'gitstats' (universe)

gitstatus: command not found

liyachao@ubuntu:~/git_hug$ git status

On branch master

 

Initial commit

 

Changes to be committed:

  (use "git rm --cached <file>..." to unstage)

 

new file:   Guardfile

new file:   README

new file:   config.rb

new file:   deploy.rb

new file:   setup.rb

 

Untracked files:

  (use "git add <file>..." to include in what will be committed)

 

database.yml

 

liyachao@ubuntu:~/git_hug$ ls

config.rb  database.yml  deploy.rb  Guardfile  README  setup.rb

liyachao@ubuntu:~/git_hug$ git add database.yml 

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

What is the full file name of the untracked file? database.yml

Congratulations, you have solved the level!

 

Name: number_of_files_committed

Level: 10

Difficulty: *

 

There are some files in this repository, how many of the files will be committed?

 

 

liyachao@ubuntu:~/git_hug$ git status

On branch master

Changes to be committed:

  (use "git reset HEAD <file>..." to unstage)

 

new file:   rubyfile1.rb

modified:   rubyfile4.rb

 

Changes not staged for commit:

  (use "git add <file>..." to update what will be committed)

  (use "git checkout -- <file>..." to discard changes in working directory)

 

modified:   rubyfile5.rb

 

Untracked files:

  (use "git add <file>..." to include in what will be committed)

 

rubyfile6.rb

rubyfile7.rb

 

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

How many changes are going to be committed? 2

Congratulations, you have solved the level!

 

Name: rm

Level: 11

Difficulty: **

 

A file has been removed from the working tree, however the file was not removed from the repository.  Find out what this file was and remove it.

 

 

liyachao@ubuntu:~/git_hug$ git status

On branch master

Changes not staged for commit:

  (use "git add/rm <file>..." to update what will be committed)

  (use "git checkout -- <file>..." to discard changes in working directory)

 

deleted:    deleteme.rb

 

no changes added to commit (use "git add" and/or "git commit -a")

liyachao@ubuntu:~/git_hug$ git rm deleteme.rb 

rm 'deleteme.rb'

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: rm_cached

Level: 12

Difficulty: **

 

A file has accidentally been added to your staging area, find out which file and remove it from the staging area.  *NOTE* Do not remove the file from the file system, only from git.

 

 

liyachao@ubuntu:~/git_hug$ git status

On branch master

 

Initial commit

 

Changes to be committed:

  (use "git rm --cached <file>..." to unstage)

 

new file:   deleteme.rb

 

liyachao@ubuntu:~/git_hug$ git rm --cached deleteme.rb 

rm 'deleteme.rb'

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: stash

Level: 13

Difficulty: **

 

You've made some changes and want to work on them later. You should save them, but don't commit them.

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

It's like stashing. Try finding appropriate git command.

liyachao@ubuntu:~/git_hug$ ls

lyrics.txt

liyachao@ubuntu:~/git_hug$ git stash

Saved working directory and index state WIP on master: 0206059 Add some lyrics

HEAD is now at 0206059 Add some lyrics

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: rename

Level: 14

Difficulty: ***

 

We have a file called `oldfile.txt`. We want to rename it to `newfile.txt` and stage this change.

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Take a look at `git mv`.

liyachao@ubuntu:~/git_hug$ git status

On branch master

nothing to commit, working directory clean

liyachao@ubuntu:~/git_hug$ git mv oldfile.txt  newfile.txt

liyachao@ubuntu:~/git_hug$ ls

newfile.txt

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: restructure

Level: 15

Difficulty: ***

 

You added some files to your repository, but now realize that your project needs to be restructured.  Make a new folder named `src`, and move all of the .html files into this folder.

 

 

liyachao@ubuntu:~/git_hug$ mkdir src

liyachao@ubuntu:~/git_hug$ git mv *.html src/

liyachao@ubuntu:~/git_hug$ git status

On branch master

Changes to be committed:

  (use "git reset HEAD <file>..." to unstage)

 

renamed:    about.html -> src/about.html

renamed:    contact.html -> src/contact.html

renamed:    index.html -> src/index.html

 

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: log

Level: 16

Difficulty: **

 

You will be asked for the hash of most recent commit.  You will need to investigate the logs of the repository for this.

 

 

liyachao@ubuntu:~/git_hug$ git log

commit a07bf4d1f7491e785ecd5bb1c717a0d492d04bc5

Author: liyachao <296777513@qq.com>

Date:   Sat Oct 18 18:13:10 2014 +0800

 

    THIS IS THE COMMIT YOU ARE LOOKING FOR!

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

What is the hash of the most recent commit? a07bf4d1f7491e785e

Congratulations, you have solved the level!

 

Name: tag

Level: 17

Difficulty: **

 

We have a git repo and we want to tag the current commit with `new_tag`.

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Take a look at `git tag`.

liyachao@ubuntu:~/git_hug$ git tag

liyachao@ubuntu:~/git_hug$ git tag new_tag

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: push_tags

Level: 18

Difficulty: **

 

There are tags in the repository that aren't pushed into remote repository. Push them now.

 

 

From /tmp/d20141018-3708-cvfeu7/

 * [new branch]      master     -> origin/master

liyachao@ubuntu:~/git_hug$ git push

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: commit_amend

Level: 19

Difficulty: **

 

The `README` file has been committed, but it looks like the file `forgotten_file.rb` was missing from the commit.  Add the file and amend your previous commit to include it.

 

 

liyachao@ubuntu:~/git_hug$ git status

On branch master

Untracked files:

  (use "git add <file>..." to include in what will be committed)

 

forgotten_file.rb

 

nothing added to commit but untracked files present (use "git add" to track)

liyachao@ubuntu:~/git_hug$ git add forgotten_file.rb 

liyachao@ubuntu:~/git_hug$ git commit --amend

[master 4eaa994] Initial commit

 2 files changed, 0 insertions(+), 0 deletions(-)

 create mode 100644 README

 create mode 100644 forgotten_file.rb

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: commit_in_future

Level: 20

Difficulty: **

 

Commit your changes with the future date (e.g. tomorrow).

 

这道题折磨了我两个小时,其实挺简单的就是到系统把时间设置成后一天,然后commit然后把时间调回来,再githug就好了

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Build a time machine, move to the future and commit your changes, then go back and verify results ;).

liyachao@ubuntu:~/git_hug$ git commit -m "future"

[master (root-commit) 26d6ac3] future

 1 file changed, 0 insertions(+), 0 deletions(-)

 create mode 100644 README

liyachao@ubuntu:~/git_hug$ git status

On branch master

nothing to commit, working directory clean

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: reset

Level: 21

Difficulty: **

 

There are two files to be committed.  The goal was to add each file as a separate commit, however both were added by accident.  Unstage the file `to_commit_second.rb` using the reset command (don't commit anything).

 

 

iyachao@ubuntu:~/git_hug$ git status

On branch master

Changes to be committed:

  (use "git reset HEAD <file>..." to unstage)

 

new file:   to_commit_first.rb

new file:   to_commit_second.rb

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

You can get some useful information for git status, it will tell you the command you need to run.

liyachao@ubuntu:~/git_hug$ git reset HEAD to_commit_second.rb

liyachao@ubuntu:~/git_hug$ git status

On branch master

Changes to be committed:

  (use "git reset HEAD <file>..." to unstage)

 

new file:   to_commit_first.rb

 

Untracked files:

  (use "git add <file>..." to include in what will be committed)

 

to_commit_second.rb

 

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: reset_soft

Level: 22

Difficulty: **

 

You committed too soon. Now you want to undo the last commit, while keeping the index.

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

What are some options you can use with `git reset`?

liyachao@ubuntu:~/git_hug$ git reset --soft HEAD~1

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: checkout_file

Level: 23

Difficulty: ***

 

A file has been modified, but you don't want to keep the modification.  Checkout the `config.rb` file from the last commit.

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

You will need to do some research on the checkout command for this one.

liyachao@ubuntu:~/git_hug$ git status

On branch master

Changes not staged for commit:

  (use "git add <file>..." to update what will be committed)

  (use "git checkout -- <file>..." to discard changes in working directory)

 

modified:   config.rb

 

no changes added to commit (use "git add" and/or "git commit -a")

liyachao@ubuntu:~/git_hug$ git checkout config.rb

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: remote

Level: 24

Difficulty: **

 

This project has a remote repository.  Identify it.

 

 

liyachao@ubuntu:~/git_hug$ git remote -v

my_remote_repo https://github.com/Gazler/githug (fetch)

my_remote_repo https://github.com/Gazler/githug (push)

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

What is the name of the remote repository? https://github.com/Gazler/githug

Sorry, this solution is not quite right!

 

Name: remote

Level: 24

Difficulty: **

 

This project has a remote repository.  Identify it.

 

 

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

What is the name of the remote repository? my_remote_repo

Congratulations, you have solved the level!

 

Name: remote_url

Level: 25

Difficulty: **

 

The remote repositories have a url associated to them.  Please enter the url of remote_location.

 

 

liyachao@ubuntu:~/git_hug$ git remote -v

my_remote_repo https://github.com/Gazler/githug (fetch)

my_remote_repo https://github.com/Gazler/githug (push)

remote_location https://github.com/githug/not_a_repo (fetch)

remote_location https://github.com/githug/not_a_repo (push)

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

What is the url of the remote repository? https://github.com/githug/not_a_repo

Congratulations, you have solved the level!

 

Name: pull

Level: 26

Difficulty: **

 

You need to pull changes from your origin repository.

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Check out the remote repositories and research `git pull`.

liyachao@ubuntu:~/git_hug$ git pull origin master

remote: Counting objects: 3, done.

remote: Total 3 (delta 0), reused 0 (delta 0)

Unpacking objects: 100% (3/3), done.

From https://github.com/pull-this/thing-to-pull

 * branch            master     -> FETCH_HEAD

 * [new branch]      master     -> origin/master

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: remote_add

Level: 27

Difficulty: **

 

Add a remote repository called `origin` with the url https://github.com/githug/githug

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

You can run `git remote --help` for the man pages.

liyachao@ubuntu:~/git_hug$ git remote add https://github.com/githug/githug origin

fatal: 'https://github.com/githug/githug' is not a valid remote name

liyachao@ubuntu:~/git_hug$ git remote add origin https://github.com/githug/githug 

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: push

Level: 28

Difficulty: ***

 

Your local master branch has diverged from the remote origin/master branch. Rebase your commit onto origin/master and push it to remote.

 

 

remote: Counting objects: 3, done.

remote: Compressing objects: 100% (2/2), done.

remote: Total 2 (delta 0), reused 0 (delta 0)

Unpacking objects: 100% (2/2), done.

From /tmp/d20141018-4696-1cn1bt1/

 * [new branch]      master     -> origin/master

liyachao@ubuntu:~/git_hug$ git rebase origin/master

First, rewinding head to replay your work on top of it...

Applying: Third commit

liyachao@ubuntu:~/git_hug$ git push origin

warning: push.default is unset; its implicit value is changing in

Git 2.0 from 'matching' to 'simple'. To squelch this message

and maintain the current behavior after the default changes, use:

 

  git config --global push.default matching

 

To squelch this message and adopt the new behavior now, use:

 

  git config --global push.default simple

 

When push.default is set to 'matching', git will push local branches

to the remote branches that already exist with the same name.

 

In Git 2.0, Git will default to the more conservative 'simple'

behavior, which only pushes the current branch to the corresponding

remote branch that 'git pull' uses to update the current branch.

 

See 'git help config' and search for 'push.default' for further information.

(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode

'current' instead of 'simple' if you sometimes use older versions of Git)

 

Counting objects: 3, done.

Compressing objects: 100% (2/2), done.

Writing objects: 100% (2/2), 224 bytes | 0 bytes/s, done.

Total 2 (delta 1), reused 0 (delta 0)

To /tmp/d20141018-4788-12sto7d/.git

   748cfe2..6cc17cf  master -> master

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: diff

Level: 29

Difficulty: **

 

There have been modifications to the `app.rb` file since your last commit.  Find out which line has changed.

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

You are looking for the difference since your last commit.  Don't forget that running `git` on its own will list the possible commands.

liyachao@ubuntu:~/git_hug$ git status

On branch master

Changes not staged for commit:

  (use "git add <file>..." to update what will be committed)

  (use "git checkout -- <file>..." to discard changes in working directory)

 

modified:   app.rb

 

no changes added to commit (use "git add" and/or "git commit -a")

liyachao@ubuntu:~/git_hug$ git diff app.rb

diff --git a/app.rb b/app.rb

index 4f703ca..3bfa839 100644

--- a/app.rb

+++ b/app.rb

@@ -23,7 +23,7 @@ get '/yet_another' do

   erb :success

 end

 get '/another_page' do

-  @message = get_response('data.json')

+  @message = get_response('server.json')

   erb :another

 end

 

liyachao@ubuntu:~/git_hug$ vim app.rb 

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

What is the number of the line which has changed? 26

Congratulations, you have solved the level!

 

Name: blame

Level: 30

Difficulty: **

 

Someone has put a password inside the file `config.rb` find out who it was.

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

You want to research the `git blame` command.

liyachao@ubuntu:~/git_hug$ git blame config.rb

^5e8863d (Gary Rennie       2012-03-08 23:05:24 +0000  1) class Config

70d00535 (Bruce Banner      2012-03-08 23:07:41 +0000  2)   attr_accessor :name, :pas

97bdd0cc (Spider Man        2012-03-08 23:08:15 +0000  3)   def initialize(name, pass

^5e8863d (Gary Rennie       2012-03-08 23:05:24 +0000  4)     @name = name

97bdd0cc (Spider Man        2012-03-08 23:08:15 +0000  5)     @password = password ||

00000000 (Not Committed Yet 2014-10-18 18:52:45 +0800  6) 

09409480 (Spider Man        2012-03-08 23:06:18 +0000  7)     if options[:downcase]

09409480 (Spider Man        2012-03-08 23:06:18 +0000  8)       @name.downcase!

09409480 (Spider Man        2012-03-08 23:06:18 +0000  9)     end

70d00535 (Bruce Banner      2012-03-08 23:07:41 +0000 10) 

ffd39c2d (Gary Rennie       2012-03-08 23:08:58 +0000 11)     if options[:upcase]

ffd39c2d (Gary Rennie       2012-03-08 23:08:58 +0000 12)       @name.upcase!

ffd39c2d (Gary Rennie       2012-03-08 23:08:58 +0000 13)     end

ffd39c2d (Gary Rennie       2012-03-08 23:08:58 +0000 14) 

^5e8863d (Gary Rennie       2012-03-08 23:05:24 +0000 15)   end

^5e8863d (Gary Rennie       2012-03-08 23:05:24 +0000 16) end

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Who made the commit with the password? Spider Man

Congratulations, you have solved the level!

 

Name: branch

Level: 31

Difficulty: *

 

You want to work on a piece of code that has the potential to break things, create the branch test_code.

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

`git branch` is what you want to investigate.

liyachao@ubuntu:~/git_hug$ git branch

* master

liyachao@ubuntu:~/git_hug$ git branch test_code

liyachao@ubuntu:~/git_hug$ git branch

* master

  test_code

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: checkout

Level: 32

Difficulty: **

 

Create and switch to a new branch called my_branch.  You will need to create a branch like you did in the previous level.

 

 

liyachao@ubuntu:~/git_hug$ git checkout -b my_branch

Switched to a new branch 'my_branch'

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: checkout_tag

Level: 33

Difficulty: **

 

You need to fix a bug in the version 1.2 of your app. Checkout the tag `v1.2`.

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

There's no big difference between checking out a branch and checking out a tag.

liyachao@ubuntu:~/git_hug$ git tag

v1.0

v1.2

v1.5

liyachao@ubuntu:~/git_hug$ git checkout v1.2

Note: checking out 'v1.2'.

 

You are in 'detached HEAD' state. You can look around, make experimental

changes and commit them, and you can discard any commits you make in this

state without impacting any branches by performing another checkout.

 

If you want to create a new branch to retain commits you create, you may

do so (now or later) by using -b with the checkout command again. Example:

 

  git checkout -b new_branch_name

 

HEAD is now at 78e6f31... Some more changes

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: checkout_tag_over_branch

Level: 34

Difficulty: **

 

You need to fix a bug in the version 1.2 of your app. Checkout the tag `v1.2` (Note: There is also a branch named `v1.2`).

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

You should think about specifying you're after the tag named `v1.2` (think `tags/`).

liyachao@ubuntu:~/git_hug$ git checkout tags/v1.2 

Note: checking out 'tags/v1.2'.

 

You are in 'detached HEAD' state. You can look around, make experimental

changes and commit them, and you can discard any commits you make in this

state without impacting any branches by performing another checkout.

 

If you want to create a new branch to retain commits you create, you may

do so (now or later) by using -b with the checkout command again. Example:

 

  git checkout -b new_branch_name

 

HEAD is now at 7672f94... Some more changes

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: branch_at

Level: 35

Difficulty: ***

 

You forgot to branch at the previous commit and made a commit on top of it. Create branch test_branch at the commit before the last.

 

 

liyachao@ubuntu:~/git_hug$ git log

commit d611689e507995a70616b4886df8e794e91cc9bb

Author: liyachao <296777513@qq.com>

Date:   Sat Oct 18 19:04:15 2014 +0800

 

    Updating file1 again

 

commit f68688e6af93f94e6c839d90b30283e15af7324c

Author: liyachao <296777513@qq.com>

Date:   Sat Oct 18 19:04:15 2014 +0800

 

    Updating file1

 

commit 90d7e42cc7a217e17b6906c30bf82133d3e2cb6a

Author: liyachao <296777513@qq.com>

Date:   Sat Oct 18 19:04:15 2014 +0800

 

    Adding file1

liyachao@ubuntu:~/git_hug$ git branch test_branch -v 90d7e42cc7a217

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: delete_branch

Level: 36

Difficulty: **

 

You have created too many branches for your project. There is an old branch in your repo called 'delete_me', you should delete it.

 

 

liyachao@ubuntu:~/git_hug$ git branch

  delete_me

* master

liyachao@ubuntu:~/git_hug$ git branch -D delete_me 

Deleted branch delete_me (was b60afe2).

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: push_branch

Level: 37

Difficulty: **

 

You've made some changes to a local branch and want to share it, but aren't yet ready to merge it with the 'master' branch.  Push only 'test_branch' to the remote repository

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Investigate the options in `git push` using `git push --help`

liyachao@ubuntu:~/git_hug$ git branch

* master

  other_branch

  test_branch

liyachao@ubuntu:~/git_hug$ git checkout other_branch 

Switched to branch 'other_branch'

liyachao@ubuntu:~/git_hug$ git push origin test_branch 

Counting objects: 7, done.

Compressing objects: 100% (6/6), done.

Writing objects: 100% (6/6), 656 bytes | 0 bytes/s, done.

Total 6 (delta 2), reused 0 (delta 0)

To /tmp/d20141018-5406-gu4ab5/.git

 * [new branch]      test_branch -> test_branch

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: merge

Level: 38

Difficulty: **

 

We have a file in the branch 'feature'; Let's merge it to the master branch.

 

 

liyachao@ubuntu:~/git_hug$ git branch

  feature

* master

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

You want to research the `git merge` command.

liyachao@ubuntu:~/git_hug$ git merge feature 

Updating e12277f..cc8ea5a

Fast-forward

 file2 | 0

 1 file changed, 0 insertions(+), 0 deletions(-)

 create mode 100644 file2

liyachao@ubuntu:~/git_hug$ git branch

  feature

* master

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: fetch

Level: 39

Difficulty: **

 

Looks like a new branch was pushed into our remote repository. Get the changes without merging them with the local repository 

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Look up the 'git fetch' command

liyachao@ubuntu:~/git_hug$ git fetch 

remote: Counting objects: 3, done.

remote: Compressing objects: 100% (2/2), done.

remote: Total 2 (delta 0), reused 0 (delta 0)

Unpacking objects: 100% (2/2), done.

From /tmp/d20141018-5534-fuemi9/

 * [new branch]      new_branch -> origin/new_branch

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: repack

Level: 40

Difficulty: **

 

Optimise how your repository is packaged ensuring that redundant packs are removed.

 

这关题目是优化包。提示是用git repack 命令。可是我试了若干次都不行。查了各种资料发现有人说git gc可以替代git repacl来使用。我试了试,居然过关了。具体原因我还不太懂。先把结果记下来:

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

You want to research the `git repack` command.

liyachao@ubuntu:~/git_hug$ git gc

Counting objects: 3, done.

Writing objects: 100% (3/3), done.

Total 3 (delta 0), reused 0 (delta 0)

liyachao@ubuntu:~/git_hug$ git hug

git: 'hug' is not a git command. See 'git --help'.

 

Did you mean one of these?

log

tag

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: cherry-pick

Level: 41

Difficulty: ***

 

Your new feature isn't worth the time and you're going to delete it. But it has one commit that fills in `README` file, and you want this commit to be on the master as well.

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Sneak a peek at the `cherry-pick` command.

liyachao@ubuntu:~/git_hug$ git branch

* master

  new-feature

liyachao@ubuntu:~/git_hug$ git checkout new-feature 

Switched to branch 'new-feature'

liyachao@ubuntu:~/git_hug$ git log

commit ea2a47c19b85fc321e2737ddc49db3deeba3a1b5

Author: Andrey <aslushnikov@gmail.com>

Date:   Wed Mar 28 02:28:35 2012 +0400

 

    some small fixes

 

commit 4a1961bce62840eaef9c4392fe5cc799e38c9b7b

Author: Andrey <aslushnikov@gmail.com>

Date:   Wed Mar 28 02:27:18 2012 +0400

 

    Fixed feature

 

commit ca32a6dac7b6f97975edbe19a4296c2ee7682f68

Author: Andrey <aslushnikov@gmail.com>

Date:   Wed Mar 28 02:25:51 2012 +0400

 

    Filled in README.md with proper input

 

commit 58a8c8edcfdd00c6d8cce9aada8f987a1677571f

Author: Andrey <aslushnikov@gmail.com>

Date:   Wed Mar 28 02:24:41 2012 +0400

 

liyachao@ubuntu:~/git_hug$ git checkout master 

Switched to branch 'master'

liyachao@ubuntu:~/git_hug$ git cherry-pick ca32a6dac7b6

[master 2559dbc] Filled in README.md with proper input

 Author: Andrey <aslushnikov@gmail.com>

 1 file changed, 1 insertion(+), 2 deletions(-)

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: grep

Level: 42

Difficulty: **

 

Your project's deadline approaches, you should evaluate how many TODOs are left in your code

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

You want to research the `git grep` command.

liyachao@ubuntu:~/git_hug$ git grep TODO

app.rb:# TODO Make site url variable.

app.rb:# TODO Make API version variable.

app.rb:# TODO Redirecting queries could be useful.

config.rb:    # TODO Move password to a configuration file.

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

How many items are there in your todolist? 4

Congratulations, you have solved the level!

 

Name: rename_commit

Level: 43

Difficulty: ***

 

Correct the typo in the message of your first (non-root) commit.

 

 

liyachao@ubuntu:~/git_hug$ git rebase -i HEAD~2

[detached HEAD c7e9f5d] First commit

 1 file changed, 0 insertions(+), 0 deletions(-)

 create mode 100644 file1

Successfully rebased and updated refs/heads/master.

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: squash

Level: 44

Difficulty: ****

 

You have committed several times but would like all those changes to be one commit.

 

 

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Take a look the `-i` flag of the rebase command.

liyachao@ubuntu:~/git_hug$ git rebase -i HEAD~3

[detached HEAD dfca21a] Updating README

 1 file changed, 3 insertions(+)

Successfully rebased and updated refs/heads/master.

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: merge_squash

Level: 45

Difficulty: ***

 

Merge all commits from the long-feature-branch as a single commit.

 

 

liyachao@ubuntu:~/git_hug$ git branch

  long-feature-branch

* master

liyachao@ubuntu:~/git_hug$ githug hint

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Take a look at the `--squash` option of the merge command. Don't forget to commit the merge!

liyachao@ubuntu:~/git_hug$ git merge --squash long-feature-branch 

Squash commit -- not updating HEAD

Automatic merge went well; stopped before committing as requested

liyachao@ubuntu:~/git_hug$ git commit -m "all"

[master ec08d95] all

 1 file changed, 3 insertions(+)

 create mode 100644 file3

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: reorder

Level: 46

Difficulty: ****

 

You have committed several times but in the wrong order. Please reorder your commits.

 

 

lliyachao@ubuntu:~/git_hug$ git branch

* master

liyachao@ubuntu:~/git_hug$ git log

commit 774ad340e98c69888971e52e56caa1d32a07ed76

Author: liyachao <296777513@qq.com>

Date:   Sat Oct 18 19:24:23 2014 +0800

 

    Second commit

 

commit 878d074b102d92c44b667870339ab96f5b674732

Author: liyachao <296777513@qq.com>

Date:   Sat Oct 18 19:24:23 2014 +0800

 

    Third commit

 

commit 0ebf7932231cb93cb238d2803d3f626652aa9ed9

Author: liyachao <296777513@qq.com>

Date:   Sat Oct 18 19:24:23 2014 +0800

 

    First commit

 

commit 44853df7ac5b6a2c09994dc4637ed3b9d5a44260

Author: liyachao <296777513@qq.com>

Date:   Sat Oct 18 19:24:23 2014 +0800

 

liyachao@ubuntu:~/git_hug$ git rebase -i HEAD~3

Successfully rebased and updated refs/heads/master.

liyachao@ubuntu:~/git_hug$ githug

********************************************************************************

*                                    Githug                                    *

********************************************************************************

Congratulations, you have solved the level!

 

Name: bisect

Level: 47

Difficulty: ***

 

A bug was introduced somewhere along the way.  You know that running `ruby prog.rb 5` should output 15.  You can also run `make test`.  What are the first 7 chars of the hash of the commit that introduced the bug.

 

 

liyachao@ubuntu:~/git_hug$ 

 

 

 


Git学习工具Githug.zip Githug 提供一个实用,轻松的方式来学习 Git,它包括一系列级别的划分,适合各种程度的用户。用户需要用 Git 命令来保证答案的正确。 安装 gem install githug 当安装完成后,用户可以运行 githug,系统会提示创建一个新的目录。Githug 可以在 Linux, OS X 和 Windows 上运行。 命令 Githug 有 5 个命令: play - 这是默认的命令,会检查你当前级别的解决方案 hint - 提供当前级别的一个提示(如果允许) reset - 重置当前级别或者重置系统给定的名字或者路径 levels - 列出所有的级别 test - 用于测试还在开发中的关卡 如果有 git 高手感兴趣,可以去制作关卡。 标签:Githug 立即下载

相关推荐

扩展卡尔曼滤波(EKF)理论讲解与实例(matlab、python和C++代码)

扩展卡尔曼滤波(EKF)理论讲解与实例(matlab、python和C++代码) 文章目录扩展卡尔曼滤波(EKF)理论讲解与实例(matlab、python和C++代码)理论讲解KF和EKF模型对比雅可比矩阵计算计算实例应用实例线性模型CV模型:CA模型非线性模型CTRV模型:CTRV实例(python)small demo抛物线demo飞机高度demoC++实例参考文献 我们上篇提到的卡尔曼滤波是用于线性系统,预测(运动)模型和观测模型是在假设高斯和线性情况下进行的。简单的卡尔曼滤波必须应用在符合高斯分布

O_MMMM_O的博客 10万+

GitHug一步一步通关帖(二)

第五题:clone代码 地址链接: https://github.com/Gazler/cloneme. LiGuicaideMacBook-Pro:git_hugGuicai$gitclonehttps://github.com/Gazler/cloneme Cloning...

ciermao3056的博客 183

【学习笔记】《基于φ-OTDR的分布式扰动传感系统定位算法研究-北交-通信与信息系统-吴》重点笔记

一、绪论 1.1 引言 光纤传感器的优点:跟电子传感器相比较,光纤传感器有诸多独特的优势:对电磁干扰免疫;具有很好的绝缘性和耐腐蚀性;灵敏度高,可测量微弱信息;可实现大范围监测和分布式传感,仅需一根传感光纤,更为经济便捷;传感光纤体积小、重量轻、可形变,适用于一些特殊应用场所;还有无需供电、耐高温、便于组网等等优点 光纤传感器的感知信号的方法:当探测光入射到光纤中时会发生散射并产生各种散射光...

qq_36045093的博客 2万+

githug游戏通关记录

level 1 题目 Name: init Level: 1 Difficulty: * A new directory, git_hug, has been created; initialize an empty repository in it. 解答 git init

qq_33907392的博客 435

R语言clusterProfiler实战:GO与KEGG富集分析从入门到精通

本文提供了一份详尽的R语言clusterProfiler实战指南,从环境配置、数据导入、基因ID转换到GO与KEGG富集分析及可视化,手把手教你解读生物学意义。文章重点介绍了如何利用clusterProfiler这一强大工具,将差异基因列表转化为清晰的生物学通路与功能故事,并分享了结果解读、可视化以及处理非模式生物等进阶技巧与避坑指南。

weixin_29044713的博客 162

玩转肺癌目标检测数据集Lung-PET-CT-Dx ——①从TCIA获取影像数据集

该目标检测公共数据集源自 The Cancer Imaging Archive(TCIA),是肿瘤研究方面的著名的医学影像公开数据库。 数据以 DICOM 格式存储,由肺癌受试者的 CT 和 PET-CT DICOM 图像组成。

takedachia的博客 1万+

git reset回退版本【Git异常】You are in ‘detached HEAD‘ state

detached HEAD称为分支游离状态。

君临天下的博客 7015

新手也能玩转!用Panosim+MATLAB/Simulink搭建你的第一个智能驾驶仿真场景(保姆级图文)

本文为新手提供了使用Panosim和MATLAB/Simulink搭建智能驾驶仿真场景的详细教程。从环境准备、基础场景创建到仿真模型构建,一步步指导用户完成第一个智能驾驶仿真项目,帮助零基础用户快速上手并体验智能驾驶仿真的乐趣。

weixin_29090089的博客 179

GIT detached HEAD

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing...

towser的博客 1610

S32DS3.5图形化配置实战:从零构建S32K144通信接口工程

本文详细介绍了如何使用S32DS3.5图形化配置工具从零构建S32K144通信接口工程。通过实战演示引脚配置、时钟树设置、SPI接口搭建等关键步骤,帮助开发者快速掌握NXP S32K系列开发技巧,提升嵌入式开发效率。特别针对S32DS3.5版本的新特性进行了深度解析,包括智能代码生成和调试优化方法。

weixin_26834815的博客 199

uniapp [安卓苹果App端] - 实现微信支付功能+拉起微信付款支付后返回本app页面,详解uniApp如何唤起本机微信app并跳转到支付页面全流程及示例源码(uniapp实现微信支付,可打包)

uni-app项目在APP端使用微信支付功能,uniapp前端实现微信支付,uniapp开发安卓App对接微信支付,uniapp苹果ios唤起微信支付,uniapp调用微信支付uniapp开发app-调用微信支付,uniapp开发安卓苹果app如何接入微信支付,前后端应该怎么做,UniApp中实现微信支付功能,支付报错,调起失败没响应,uniapp苹果微信支付唤起实现,app唤起微信支付,拉起微信支付,uniapp中唤醒微信进行支付并返回app,uniApp调起微信支付失败报错,全网最详细的uniapp微信

🏆 前端领域优质创作者 1万+

git detached HEAD 状态最优雅的解救

git ‘detached HEAD’ 状态的解救 detached HEAD 状态是指 HEAD 指针不指在任何分支的索引(比如 master、dev)。 进入 detached HEAD 状态后 git 会创建一个临时分支。 如果想退回直接 git checkout 想要的分支。 否则操作后,要 git add、git commit 然后 git checkout -b 新的分支,不然临时分...

u011714033的博客 5537

使用abagen工具箱获取基于脑区的基因表达矩阵

脑区模板定义了您感兴趣的脑区的空间位置。abagen提供了一些预定义的脑区模板,您可以选择使用,也可以使用自定义的脑区模板。它提供了一种简便的方式来获取基于脑区的基因表达矩阵。abagen需要使用Allen脑图谱数据来获取基因表达矩阵。您可以使用abagen内置的下载功能来获取这些数据。这就是使用abagen工具箱获取基于脑区的基因表达矩阵的详细步骤。通过按照上述步骤操作,您可以轻松获取并使用Allen脑图谱数据中的基因表达信息。一旦您加载了脑区模板,您可以使用abagen来获取基于脑区的基因表达矩阵。

web_bug407的博客 1326

git checkout tag报错 * (no branch) 提示 detached HEAD

git clone Spark源码后想切换到指定的标签版本:2.0.2,但是一直切换不了,报错是: [root@cm03 spark]# git checkout v2.0.2 Note: checking out 'v2.0.2'. You are in 'detached HEAD' state. You can look around, make experimental chang

荒野雄兵的专栏 1万+

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

git 游离的head

git 指针 所以切换分支的本质就是移动HEAD 指针。 游离原因 一般我们会使用命令 git checkout <branch_name>来切换分支,HEAD 就会移动到指定的分支上。 但是,如果我们使用的是git checkout <commit_id> 来切换到指定的某一次提交,HEAD 就会处于「detached」状态,也就是游离状态。 HEAD 游离状态的利弊 好处:HEAD 处于游离状态时,开发者可以很方便地在历史版本之间互相切换,比如要回到某次提交,只需要 ch

qq_35024768的博客 2218

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

git 官方文档跟读--第二章(5)

1.本地标签操作,远程标签操作 2.checkout -b 创建并切换分支 3.别名

qq_39741993的博客 433

git detached HEAD 修改后如何提交修改到其他分支

有次工作中git切换分支时,不小心前面加了origin/,但是像往常一样没有注意,直接在新分支上修改代码,等到要提交时给出的提示是git detached HEAD,还说切换分支之前请确保代码不会丢失,所以此时是可能造成修改的代码丢失的。 首先说下 detached Head 的意义,就是处于游离状态,就是处于一个没有分支名字的分支,指向切换分支时的最新提交,也可以只想其他任意提交。 git de...

lidongxiu0714 4463

【git】fix clone 服务端仓库的问题

git

突围 898

git常用命令及常见问题

1、使用git克隆指定分支的代码 如图,一个项目有多个分支的情况下 我们需要克隆指定的分支 使用Git下载指定分支命令为:git clone -b 分支名仓库地址 $ git clone -b dev + 仓库地址

huihuiliu_的博客 5258

git操作提示warning: redirecting to git@github.com:XXXXX

一、前提: 常用git clone 有两种方式 ssh方式:git@github.com:Nehic/demo.git https方式:https://github.com/Nehic/demo.git 查看方式:gitlab或者github等的clone里面 二、问题描述: 每次git操作都提示: warning: redirecting to git@github.com:Nehic/demo.git git push和git pull均失败 三、解决方式 // 移除所有origin git remot

qq_39397845的博客 1万+

git常用操作

分支gua 查看分支:git branch 创建分支:git branch <name> 切换分支:git checkout <name> 创建+切换分支:git checkout -b <name> 合并某分支到当前分支:git merge <name> 删除分支:git branch -d <name> ...

mary0712的博客 2834

子树合并

现在你已经看到了子模块系统的麻烦之处,让我们来看一下解决相同问题的另一途径。当 Git 归并时,它会检查需要归并的内容然后选择一个合适的归并策略。如果你归并的分支是两个,Git使用一个_递归_策略。如果你归并的分支超过两个,Git采用_章鱼_策略。这些策略是自动选择的,因为递归策略可以处理复杂的三路归并情况——比如多于一个共同祖先的——但是它只能处理两个分支的归并。章鱼归并可以处理多个分支但是但必

飞翔的蜗牛 1041

Git 时间线管理

这一部分主要讲的是 取消(undo) 变化 和在不同的时间锚点跳来跳去,以 command 为主。

GoldenaArcher的博客 1069

githug游戏命令记录(持续更新)

Githug 旨在为您提供一种实用的学习 git 的方法。它有一系列级别,每一关都要求您使用 git 命令才能得出正确答案。

subtitle_的博客 1425

Git下载安装及设置详细教程

一、安装前准备 Git教程 :推荐Git入门教程。 按照自己的系统版本下载Git软件,我的操作系统:Windows10 64位,安装版本为Git-2.18.0-64-bit.exe(截至2018.8.27最新版本)。 二、安装过程 1. 下载完成后,双击下载好的软件开始安装,出现如下对话框  2. 点击Next,默认选项和图中不一样,建议按照图中修改,Git Bash Here和Git GUI Here可以方便的在任意目录下打开git,建议选中,选中这两项后Additional icons->

ZPeng_Yan的博客 3908

Git学习笔记

概念 1.Repository:保存文件和目录的状态的场所。分为Remote 和Local两种。 2.新建Local Repository方法有两种:克隆远程Repository和Local新建Repository 3.Work Tree:用户实际操作的目录 4.Index:向Repository Commit作准备的存储区域。可以把部分想要Commit的更改存入Index然后向Repos

u013582663的专栏 987
下一篇: Android-计步器的学习心得
Bobby_lyc
博客等级 码龄16年 1164粉丝 89原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值