Get current version of repository

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.

  • EGit working / root directory
  • Should composer.lock be committed to version control?
  • Robust workflow for catching up with a master branch?
  • Visual Studio not showing Git commit options in context menu
  • how to compress all commit history into one commit?
  • How to use multiple Git SSH keys on Eclipse?
  • How can i have something like this :

    Your version : 1.9.0
    Latest version : 1.10.1

    With conky as example :

  • Measure / count objects in Git to see whether I am close to auto-packing
  • managing git and svn at the same time?
  • Does git clean support moving to Recycle Bin?
  • git merging two commits
  • How to get `git commit --verbose` output via `git diff`?
  • Show git pull graph in other situations
  • 3 Solutions collect form web for “Get current version of repository”

    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

    Git repositories don’t have any kind of a monolithic “version”, that they can be labeled with.

    A git repository has one or more branches, with some commit at the head of each branch.

    Git repositories also have a few other ancillary details, like tags.

    Git is not like subversion, or CVS. There is no monolithic “version” identifier that gets incremented with every commit. Git doesn’t work like that.

    You can always execute a git fetch command (which will cover both of your questions)

    git fetch --all --prune

    This command will update your local repository with all the latest code from the remote repository.

    Once you do it you can merge code into your branch from the local repo (offline)

    Git Baby is a git and github fan, let's start git clone.