How can I reset my default home directory in Git?

不羁的心 提交于 2019-12-25 20:06:18

问题


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

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.

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

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

If I type:

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

I get:

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

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)

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


回答1:


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

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



回答2:


With git branches they aren't really directories on your computer.. at somepoint did you type

 `git checkout (include-andras-destinations)`  ?

You may try git checkout master if that's the case to get back to your repo's main branch.



来源:https://stackoverflow.com/questions/50806510/how-can-i-reset-my-default-home-directory-in-git

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!