• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 42  文章 - 3  trackbacks - 0
            <2012年7月>
            24252627282930
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            常用鏈接

            留言簿(2)

            隨筆檔案

            文章檔案

            網(wǎng)頁收藏

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            Create a new local repository:
            prompt> mkdir /path/to/repo:
            prompt> cd /path/to/repo
            prompt> git init
            Initialized empty Git repository in /path/to/repo/.git/
            prompt>
            ... create file(s) for first commit ...
            prompt> git add .
            prompt> git commit -m 'initial import'
            Created initial commit bdebe5c: initial import.

            1 files changed, 1 insertions(+), 0 deletions(-)
            Note that the commit action only commits to your local repository.

            Change one of my github repo name in two steps:

            Firstly, cd to your local git directory, and find out what remote name(s) refer to that URL

            $ git remote -v origin  git@github.com:someuser/someproject.git 

            Then, set the new URL

            $ git remote set-url origin git@github.com:someuser/newprojectname.git 

            or in older versions of git, you might need

            $ git remote rm origin $ git remote add origin git@github.com:someuser/newprojectname.git 

            (origin is the most common remote name, but it might be called something else.)

            But if there's lots of people who are working on your project, they will all need to do the above steps, and maybe you don't even know how to contact them all to tell them. That's what #1 is about.

            Further reading:

            Footnotes:

            1 The exact format of your URL depends on which protocol you are using, e.g.

            push your local repository into remote repository:
            prompt>git push origin master
            To amend the last wrong commit:

            git commit --amend -m "New commit message"

             

            If the commit you want to fix isn’t the most recent one:

            1. git rebase --interactive $parent_of_flawed_commit

              If you want to fix several flawed commits, pass the parent of the oldest one of them.

            2. An editor will come up, with a list of all commits since the one you gave.

              1. Change pick to reword (or on old versions of Git, to edit) in front of any commits you want to fix.
              2. Once you save, git will replay the listed commits. 

            3. Git will drop back you into your editor for every commit you said you want to reword, and into the shell for every commit you wanted to edit. If you’re in the shell:

              1. Change the commit in any way you like.
              2. git commit --amend
              3. git rebase --continue

            Most of this sequence will be explained to you by the output of the various commands as you go. It’s very easy, you don’t need to memorise it – just remember that git rebase --interactive lets you correct commits no matter how long ago they were.

            Today, when I try to push some code to the remote, it told me the there is a permission issue, I finally fixed it by created a new key, add it to my git account and local account. Here is the process of adding to local


            $ git push -u origin master
            Permission denied (publickey).
            fatal: The remote end hung up unexpectedly

            $ ssh -vT git@github.com
            OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
            debug1: Connecting to github.com [207.97.227.239] port 22.
            debug1: Connection established.
            debug1: No more authentication methods to try.
            Permission denied (publickey).

            $  ssh-add -l
            Could not open a connection to your authentication agent.

            $ eval `ssh-agent`
            Agent pid 4968

            If you did not have a key, generate one according this 
            https://help.github.com/articles/generating-ssh-keys

            then add the key
            $  ssh-add /c/Users/li/.ssh/key
            Identity added: /c/Users/li/.ssh/key

            $ ssh -vT git@github.com
            OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
            debug1: Connecting to github.com [207.97.227.239] port 22.
            debug1: Connection established.
            debug1: identity file /c/Users/li/.ssh/identity type -1

            Hi ***! You've successfully authenticated, but GitHub does not provide shell access.
            debug1: channel 0: free: client-session, nchannels 1
            debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.3 seconds
            debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
            debug1: Exit status 1


            $ git push -u origin master
            Counting objects: 46, done.
            Delta compression using up to 4 threads.
            Compressing objects: 100% (42/42), done.
            Writing objects: 100% (46/46), 21.33 KiB, done.
            Total 46 (delta 1), reused 0 (delta 0)

            Clone your repository

            Create a new repository in a new directory via the following commands.

             

            # Switch to home
            cd ~
            # Make new directory
            mkdir repo02
            
            # Switch to new directory
            cd ~/repo02
            # Clone
            git clone ../remote-repository.git . 

             

            posted on 2012-07-09 22:04 鷹擊長(zhǎng)空 閱讀(448) 評(píng)論(0)  編輯 收藏 引用

            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            久久久久亚洲av毛片大| 久久精品国产精品青草 | 伊人久久大香线蕉影院95| 亚洲av日韩精品久久久久久a | 久久精品国产91久久麻豆自制| 久久天天躁夜夜躁狠狠躁2022| 久久影院亚洲一区| 亚洲精品高清一二区久久| 久久亚洲2019中文字幕| 最新久久免费视频| 99精品久久精品一区二区| 久久无码人妻一区二区三区午夜| 国产毛片欧美毛片久久久| 国产成人精品白浆久久69| 久久精品国产91久久综合麻豆自制| 97精品伊人久久大香线蕉app| 狠狠色噜噜狠狠狠狠狠色综合久久| av午夜福利一片免费看久久| 久久综合狠狠综合久久激情 | 久久WWW免费人成—看片| 久久久久黑人强伦姧人妻| 亚洲?V乱码久久精品蜜桃 | 日韩精品无码久久久久久| 久久国产精品99精品国产| 大美女久久久久久j久久| 亚洲欧美日韩精品久久亚洲区| 久久久久国产精品嫩草影院| 久久人爽人人爽人人片AV| 伊人久久精品线影院| 久久伊人精品一区二区三区| 久久精品国产亚洲77777| 精品久久国产一区二区三区香蕉 | 久久99精品久久久久婷婷| 国产毛片久久久久久国产毛片 | 欧美一区二区三区久久综合| 精品精品国产自在久久高清| 久久国产精品视频| 亚洲国产精品无码久久久不卡| 99精品国产在热久久无毒不卡| 久久久网中文字幕| 97r久久精品国产99国产精|