如何在Git中重置默认主目录? [英] How can I reset my default home directory in Git?

查看:106
本文介绍了如何在Git中重置默认主目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在udacity.com上一个前端开发课程.我目前正在学习Git,但遇到问题.

I am taking a front-end dev course on udacity.com. I am currently learning Git and I am stuck.

我当时在从事一个项目,我认为自己正在按照说明进行操作,并创建了一个名为"include-andras-destinations"的分支.不知何故,这个分支现在已经是我的主目录的一部分,但是我想使用一个不同的目录来存储我的Git项目,并且在括号内,它应该是:(主文件),如所附图片所示.

I was working on a project and I thought I was following instructions and making a branch called 'include-andras-destinations'. Somehow, this branch is now part of my home directory, but I want to use a different directory to store my Git projects and inside the parentheses, it should be: (master), like in the attached pic.

任何人都知道如何重置我的默认主目录/分支并摆脱"include-andras-destination"吗?

Anyone knows how can I reset my default home directory/branch and get rid of "include-andras-destination"?

我希望udacity-git-course文件夹成为我的主人(是吗?)

I would like udacity-git-course folder to be my master (is that right?)

如果我输入:

cd /Users/ruxandravasilescu/Desktop/udacity-git-course

我得到:

ruxandravasilescu (include-andras-destinations) udacity-git-course

我不明白为什么该分支总是存在!否则,git似乎设置正确.我在Mac上工作.以下是我的终端机上的一些信息

I don't understand why is that branch always present! Otherwise, git seems set-up okay. I work on a mac. Below is a little info from my terminal

ruxandravasilescu (include-andras-destinations) ~
$ cd
ruxandravasilescu (include-andras-destinations) ~
$ git init
Reinitialized existing Git repository in /Users/ruxandravasilescu/.git/
ruxandravasilescu (include-andras-destinations) ~
$ pwd
/Users/ruxandravasilescu
ruxandravasilescu (include-andras-destinations) ~
$ git status
On branch include-andras-destinations
Untracked files:
  (use "git add <file>..." to include in what will be committed)

在Mac上,Udacity的git设置如下所示,这也是我的终端最初的外观:

Udacity's git setup on mac looks like this and that's how my terminal initially looked also:

推荐答案

您在主目录中创建了一个git repo.只需将其删除,就可以了:

You created a git repo in your home directory. Just remove it and you should be fine:

$ rm -rf /Users/ruxandravasilescu/.git/ 

这篇关于如何在Git中重置默认主目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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