微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

git已经是最新的,没有任何理由

如何解决git已经是最新的,没有任何理由

git初学者在这里,我一直在阅读有关此内容的信息,但仍然没有得到它,有人可以澄清一下。我的问题是我有git'master',这是这样的:

import { Component,ViewChildren,ElementRef,QueryList,AfterViewInit } from '@angular/core';

@Component({
  selector: 'test-selector',templateUrl: './test.component.html'
})
export class TestComponent implements AfterViewInit {
  @ViewChildren('myTemplateImage') imageList: QueryList<ElementRef>;

  ngAfterViewInit() {
    this.imageList.forEach((item) => {
      item.nativeElement.parentNode.style.fontStyle = 'italic';
    });
  }
}

在这里,我还有另一个分支'kolmas'及其代码

const list = [ 'h','e','l','o'];
list.map((currElement,index) => {

  console.log("muutettu : " + index);
  console.log("The curre:  " + currElement);
  console.log("\n");
  return currElement; //equivalent to list[index]
});

我正在切换到分支主站'git checkout主站 '然后尝试将分支'kolmas'合并到该主分支中(git merge kolmas),我得到:已经是最新的。但是它不是最新的,它没有改变任何东西。

解决方法

  1. 使用git checkout master; git diff kolmas检查masterkolmas是否相同
  2. 如果它们相同并且您确实更改了代码,请使用git status检查它们是否已提交。
  3. 如果您可以使用git statusgit checkout kolmas查看更改,请分别使用git addgit commit进行提交。
  4. 提交更改后,您可以git checkout master并立即git merge

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。