Delete / upload projects to git hub

0

I have a problem in github that I do not know how to solve it since I am a newbie in the repositories topic. It turns out that I uploaded a project to a remote repository from my local repository. Now I need to delete what is in the remote repository to leave it empty and upload a new project to it from my local, I'm not sure how to do it, since I made an init in my new project to create a new repository to link it to the remote , delete what is remote and upload what I have in local. How would this be done? that is, the commands to follow in the windows cmd console to perform this operation.

Thanks

    
asked by elvega 22.07.2018 в 13:51
source

2 answers

1

Method 1:

Enter your project on github:

https://github.com/miusuario/miproyecto

Enter the end of "Settings" as shown in the image and click on the "Delete this repository" button:

Once the github project has been removed, create it again (it can be with the same name):

https://github.com/new

Go to the folder where your local repository is and delete the ".git" folder. This folder is hidden. In Linux you can see it with CTRL + H. In Windows, check the option "Show hidden files"

Now it remains to link the local repository with the github repository and upload the files. Example:

cd /home/user/miproyecto/
git config --global user.name "miusuario"
git config --global user.email "[email protected]"
git init
git add .
git commit -m "Lo que quieras poner"
git push -f origin master

Method 2:

The second method is to relocate the repository. The detailed explanation, step by step, can be found in the post " Github : This repository moved. Please use the new location "

    
answered by 08.12.2018 в 22:57
0

To delete all the files in the repository, you must first remove everything you do not want from your local folder and then synchronize it with your github repository.

The steps:

  • You delete everything you no longer want in the repository of your project in the local folder.
  • Go to the console, you will be placed in the directory where your project is.
  • You write:

    git add * (with this you are adding or removing everything from your folder to the github repository)

    git commit -m 'borrando archivos ya no usados' (you indicate that you are going to delete the files)

    git push origin master (uploads the changes to the master branch)

  • And with that already would be, now the files that you have deleted in your local folder, will not be in your repository of github.

        
    answered by 22.07.2018 в 16:16