获取当前版本的存储库 [英] Get current version of repository

查看:67
本文介绍了获取当前版本的存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是GIT的新手,但我找不到如何:


  1. 获取版本库(文件夹离线)

  2. 获取存储库的最新版本(在线)

我只能比较这两个,但它并没有给我任何关于该版本的信息。 : git status ,只是告诉我它是最新的。



我怎么能这样:

 您的版本:1.9.0 
最新版本:1.10.1



conky 为例: https://github.com/brndnmtthws/conky

解决方案

没有干净的方式来做到这一点,因为当前版本的存储库对不同的人意味着不同的事情。它也很大程度上取决于是否使用标签。

在这种情况下,如果您想完全依赖标签,那么您可以使用 git tag -l <​​/ code>来获得所有标签的列表,最近创建的标签是最后一个标签。



如果你想最近承诺的工作,你必须看看你自己的意愿分支,并检查什么时候发生。在这种情况下,它是主人,所以你需要做的就是执行一个日志。

  git checkout master& amp ;&安培; git log 


I'm new to GIT, but i can't find out how to :

  1. Get the version of a repository (folder offline)
  2. Get the last version of a repository (online)

I can only compare the two, but it doesn't give me any information about the version. : git status, just tell me it's up to date.

How can i have something like this :

Your version : 1.9.0
Latest version : 1.10.1

With conky as example : https://github.com/brndnmtthws/conky

解决方案

There's really no clean way to do this, since "current" version of the repository means different things to different people. It also strongly depends on whether or not tags are used.

In this scenario, if you want to rely exclusively on the tags, then you can use git tag -l to get a listing of all tags, with the most recent one created being the last entry.

If you want the most recently committed work, you'd have to look at the branches of your own volition and inspect when something was committed. In this case, it's master, so all you'd need to do is perform a log on it.

git checkout master && git log

这篇关于获取当前版本的存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆