How can I connect to my repository again?

Asked

Viewed 296 times

-3

I had on my pc a folder connected with my github repository, recently I formatted the pc and lost this folder, wanted to know how to connect with my repository and continue being the master branch? being the same user

  • 1

    open a cmd and type git clone url_do_repo

  • 2

    This answers your question? Github - Download project (Beginner)

  • 1

    But the deleted folder has nothing to do with REMOTE branch control, it has no sense, REMOTE is REMOTE, o LOCAL is the LOCAL, if lost the LOCAL but saved everything before losing just clone again and follow where you left and to have access to the master is a matter of permission in REMOTE, if you had permission to your user before probably still, it has nothing to do with the deleted folder.

3 answers

1

  • Install the Git;
  • Open Terminal or Command Prompt;
  • Navigate to the folder you want to place your codes in;
  • Execute git clone <<url do seu repositório>> Example: git clone https://github.com/vuejs/vue.git;

0

You can make a nova pasta anywhere you want and from her do your master, woe you clonar your projects in this folder. One advice is you have the GitBash, then you open it right into your new folder where it will be yours master and from there you can make a clone after conectar your account of Github.

0

I had a similar problem recently, and the solution was the following:

  • Make a git clone to download the repository on your machine;
  • Done that, give one git init, git add -A, git commit etc. in the project, as if it were a new project, normally.
  • After that, done everything right, when it comes time to do the git push, you will pass the attribute --force, then it would look like this:
git push --force origin master

The --force will erase everything you have in your repository and replace it with the system you are sending, so be very careful when using it, in this case it is not a problem because it is your own repository.

By doing this process, you will be able to use the master branch normally, it worked with me, but in my case it was because I wanted to have the project on two machines :)

I hope I helped. Hugging!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.