How do you get the Git repository's name in some Git repository?

前端 未结 17 1278
囚心锁ツ
囚心锁ツ 2020-12-22 16:18

When you are working in some Git directory, how can you get the Git repository name in some Git repository? Are there any Git commands?

# I did check out bar         


        
17条回答
  •  梦毁少年i
    2020-12-22 16:47

    Also I just find that there is some repo information inside .git directory. So you can just watch FETCH_HEAD file in terminal to see repo's name:

    Example:

    cd your_project_folder/.git
    more FETCH_HEAD
    

    Output:

    672e38391557a192ab23a632d160ef37449c56ac        https://bitbucket.org/fonjeekay/some_repo
    

    And https://bitbucket.org/somebituser/some_repo.git is the name of your repository

提交回复
热议问题