Search code examples
gitcvs

What is git equivalent of the following cvs command


we are moving from cvs to git. I want to know what the following cvs commands does and its output

cvs -n checkout -p -r${RELEASE} ${MODULE}

I also need git equivalent of following cvs command.

Thanks for your help


Solution

  • To check if repo exists, if exists 0 is returned else 128 is returned

    **git ls-remote --heads http://user:pass@github.com:user/repo.git**
    

    To check if branch exists in repo, if branch not found no output else one line is printed

    **git ls-remote --heads http://user:pass@github.com:user/repo.git branch**
    

    To check if tag exists in repo, if branch not found no output else on line is printed

    **git ls-remote --tags http://user:pass@github.com:user/repo.git v7_3**
    

    Return code in above 2 cases is 0 always whether branch/tag found or not