<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Chan Chen Coding...

    Git: Your branch is ahead of the tracked remote branch

    Problem

    When moving to a local branch, git says I'm "ahead of the tracked remote branch", but a git push doesn't update the remote branch.

    $ git checkout mybranch 

    Your branch is ahead of the tracked remote branch 'origin/remotebranch' by 1 commit.
    $ git push Everything up-to-date

    Solution 1. Pushing mybranch to remotebranch

    $ git push origin mybranch:remotebranch 

    or for later pushes with just git push origin you can put this in .git/config with this command:

    $ git config remote.origin.push mybranch:remotebranch 

    Solution 2. Reset mybranch to state of remotebranch

    NOTE: Careful! You will loose commits made to mybranch!

    $ git reset --hard origin/remotebranch 

    Problem: You cann't push to git://github.com/username/repo.git

    There should be something wrong with your remote configuration, set like the follow:
    $ git remote rm origin 
    $ git remote add origin
    $ git remote add origin git@github.com:tualatrix/gentoo.git
    $ git push origin

    Problem: Permission denied (publickey)

    1. Generate a new SSH key.

      To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.

      $ ssh-keygen -t rsa -C "your_email@youremail.com"Creates a new ssh key using the provided emailGenerating public/private rsa key pair.Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):<press enter>

      Now you need to enter a passphrase.

      Why do passphrases matter?

      Enter passphrase (empty for no passphrase):<enter a passphrase>Enter same passphrase again:<enter passphrase again>

      Which should give you something like this:

      Your identification has been saved in /Users/your_user_directory/.ssh/id_rsa.Your public key has been saved in /Users/your_user_directory/.ssh/id_rsa.pub.The key fingerprint is:01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db user_name@username.comThe key's randomart image is:+--[ RSA 2048]----+|     .+   +      ||       = o O .   ||        = * *    ||       o = +     ||      o S .      ||     o o =       ||      o . E      ||                 ||                 |+-----------------+
    2. Add your SSH key to GitHub.

      On the GitHub site Click “Account Settings” > Click “SSH Public Keys” > Click “Add another public key”

      Account Settings

      Open the id_rsa.pub file with a text editor (Notepad, TextEdit, or gedit will do just fine). This is your public SSH key. You may need to turn on “view hidden files” to find it because the.ssh directory is hidden. It’s important you copy your SSH key exactly as it is written without adding any newlines or whitespace. Now paste it into the “Key” field.

    Problem: Delete file on remote repo
    $ git add . -A
    $ git commit -m "remove some file"

    $ git add . -A
    $ git commit -m "remove some file"



    -----------------------------------------------------
    Silence, the way to avoid many problems;
    Smile, the way to solve many problems;

    posted on 2012-02-24 17:07 Chan Chen 閱讀(1315) 評論(0)  編輯  收藏 所屬分類: Software Methodology


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲人成综合在线播放| 亚洲黄网在线观看| 四虎永久免费观看| 免费看男女下面日出水视频| 亚洲精品亚洲人成在线播放| 亚洲精华国产精华精华液好用| 日韩久久无码免费毛片软件| 中文字幕一区二区免费| 少妇高潮太爽了在线观看免费| 俄罗斯极品美女毛片免费播放| 亚洲av无码一区二区三区网站| 亚洲1234区乱码| 精品一区二区三区免费视频| 黄+色+性+人免费| 亚洲精品黄色视频在线观看免费资源| 亚洲人成网站在线观看播放| 亚洲免费网站观看视频| 国产一区二区三区免费| 午夜毛片不卡免费观看视频| 国产亚洲免费的视频看| 国产精品久久久久久亚洲小说| 午夜爽爽爽男女免费观看影院| 国产成人啪精品视频免费网| 亚洲国产人成在线观看69网站| 免费人成视频在线观看免费| 国产aⅴ无码专区亚洲av麻豆| 亚洲 暴爽 AV人人爽日日碰| 三年片在线观看免费观看大全动漫 | 成人性生交视频免费观看| 亚洲av综合av一区| 国产在线观看麻豆91精品免费| 色欲aⅴ亚洲情无码AV蜜桃| A在线观看免费网站大全| 妇女自拍偷自拍亚洲精品| 免费看美女被靠到爽| 日韩亚洲国产综合高清| 国产成人亚洲精品影院| 4hu四虎免费影院www| 国产精品亚洲高清一区二区| 最近2019中文字幕免费直播| 久久精品夜色国产亚洲av|