Do I have to delete some files from project downloaded from GitHub if I want to put the project in another GitHub repository and to continue committing there?

Anonymous User 1 Reputation point
2020-12-10T17:01:15.683+00:00

From november 2019 to may 2020 I've been creating Xamarin.Android project on Computer A and I've been pushing the commits into Repository A in GitHub. Some days ago I downloaded the Xamarin.Android project from Repository A as a zip file on Computer B and unzipped the project. I want to continue the developing of the Xamarin.Android project on Computer B and to stop pushing commits into Repository A in GitHub, and I want to create Repository B in GitHub and when I make some changes, to commit there. My question is do I have to delete some files from the downloaded Xamarin.Android project on Computer B before putting it into Repository B so I don't get errors when I put the Xamarin.Android project into Repository B and when I start making commits in that repository?

P.S.: Sorry for saying "Computer A", "Repository B" etc. but if I had said "that computer", "the previous computer", "this repository", "that repository" etc. I think it would have been more difficult to understand what repository/computer I am talking about.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
4,937 questions
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JessieZhang-MSFT 7,526 Reputation points
    2020-12-11T08:28:30.737+00:00

    Hello,

    Welcome to our Microsoft Q&A platform!

    Do I have to delete some files from project downloaded from GitHub if I want to put the project in another GitHub repository and to continue committing there?

    It's depends your needs. This does not affect re-uploading to the new repository.

    You can follow the below steps:

    1. create new repository in github(e.g. TestApp1211). After that, you can see the following screen:

    47238-1211.png

    2.copy the new created url, then go to your computer and gitclone the new repository :

    47239-image.png

    3.After that, you will find a new folder:

    47178-image.png

    4.You can copy your modified app to this folder, after that you uoload your modified app to github by using the following command:

       $ git add .  
    
       $ git commit -m "test"  
    
       $ git push -u origin master  
    

    5.Then we will upload our modified app to a new repository successfully.

    47315-image.png

    Note:The App2020318 is another repository in my github, and I downloaded it to my computer and uploaded it to a new repository .

    Best Regards,

    Jessie Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. JarvanZhang 23,866 Reputation points
    2020-12-17T03:09:44.92+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    Hi, @Anonymous User . It's unnecessary to delete some files before uploading the project into Repository B. Please empty the bin and obj folder otherwise the sample will be very large.

    You could use the git remote command to modify the url of repository.

    cd repositoryA
    git remote rm origin
    git remote add origin repositoryB_url

    Or

    cd repositoryA
    git remote set -url origin repositoryB_url

    Check the link: https://forums.xamarin.com/discussion/186665/deleting-some-files-from-project-downloaded-from-github-before-committing-in-another-repository

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.