<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 閱讀(1306) 評論(0)  編輯  收藏 所屬分類: Software Methodology


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


    網站導航:
     
    主站蜘蛛池模板: 国产免费观看a大片的网站| 毛片免费全部免费观看| 亚洲一区二区三区自拍公司| 深夜A级毛片视频免费| 亚洲AV蜜桃永久无码精品| av电影在线免费看| 在线精品亚洲一区二区小说| 国产日韩久久免费影院| 亚洲精品无码精品mV在线观看 | 一个人免费观看视频在线中文| 免费女人18毛片a级毛片视频| 免费无码一区二区| 亚洲日韩欧洲无码av夜夜摸| 日韩在线永久免费播放| 波多野结衣亚洲一级| 亚洲AⅤ无码一区二区三区在线| 中文字幕永久免费| 亚洲综合免费视频| 日韩在线视频免费看| 色婷婷综合缴情综免费观看| 亚洲老妈激情一区二区三区| 一区二区三区福利视频免费观看| 337P日本欧洲亚洲大胆艺术图| 全部免费a级毛片| 青柠影视在线观看免费| 亚洲电影日韩精品| 免费a级毛片无码a∨免费软件| 亚洲精品免费在线| 国产成人免费a在线视频色戒| 国产免费一级高清淫曰本片| 亚洲欧洲日产专区| 亚洲人午夜射精精品日韩| 最近免费中文字幕高清大全| 在线观看亚洲网站| 亚洲va在线va天堂va不卡下载| 成人人免费夜夜视频观看| jlzzjlzz亚洲jzjzjz| 亚洲精品国产日韩无码AV永久免费网 | 日本亚洲视频在线| 成年美女黄网站18禁免费| 三年片免费高清版 |