是否有.gitconfig pull选项来始终获取带注释的标签?

时间:2015-12-11 03:21:32

标签: git

Git 2.4.1引入了push.followTags选项,它会自动推送带注释的标签。也就是说,它使git push...每个git push --follow-tags...等同于git pull ,这正是我想要的。

但我无法弄清楚如何在拉动时获得相同的行为。也就是说,我想要每一个

git pull && git fetch --tags

相当于:

import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemListener;

public class JPopulation extends JFrame implements ItemListener
{
   JLabel intro = new JLabel("Please Select a City");
   String[] cityList = {"Los Angeles", "San Diego", "Phoenix", "Houston", "Detroit", "Chicago", "New York City"};
   String[] cityPopValues = {"12 Million", "6 Million", "5 Million", "4 Million", "Population 0", "7  Million", "10 Million"};
   JComboBox listOfCities = new JComboBox(cityList);
   JTextField cityPop = new JTextField(cityPopValues[0], 10);
   FlowLayout flow = new FlowLayout();

   public JPopulation()
   {
      super("Find the Population of Your City");
      final int WIDTH = 300;
      final int HEIGHT = 125;
      final int X_POS = 960 - (WIDTH / 2);
      final int Y_POS = 540 - (HEIGHT / 2);

      setSize(WIDTH, HEIGHT);
      setLocation(X_POS, Y_POS);
      setLayout(flow);
      setDefaultCloseOperation(EXIT_ON_CLOSE);

      add(intro);
      add(listOfCities);
      add(cityPop);

      cityPop.setHorizontalAlignment(JLabel.CENTER);

      listOfCities.addItemListener(this);

   }

有没有可以完成此任务的选项?

1 个答案:

答案 0 :(得分:1)

正如我在“Does “git fetch --tags” include “git fetch”?”中所提到的,因为git 1.9+; git fetch --tag包含git fetch +标签 git pull --tags也会包含它们。

因此,除了--tags通常从遥控器获取的内容之外,添加git fetch/pull是获取标记的最可靠方法。

但默认情况下,不会自动提取标记,以避免污染本地存储库的标记命名空间,尤其是使用仅提取+refs/heads/*:refs/remotes/origin/*的默认refspec heads