Suppose there is a remote branch with a project called project , and I need to copy this project locally.
I created an empty folder, let test-project , in the console enter

git init 

being in this folder. Then I enter in the console

 git clone http://bitbucket.org/project.git 

As a result, another project folder is created in the test-project folder with the project.
And I need the project to be copied to the test-project folder, i.e. so that the additional project folder is not created, which also has its own .git folder
It turns out that there will be two .git folders (in the test-project folder and in the project folder)
How to copy the project correctly, so that later local changes can be thrown back to the remote branch, zakomitit

    1 answer 1

    There is no need to perform git init when cloning. You just need to properly clone. So, delete the folder and its contents and execute such

     git clone http://bitbucket.org/project.git test-project 

    a test-project folder will be created and everything is tilted there.

    • and tell me, after local code editing, to send changes to a remote branch, do you need to perform a git push origin master? Do I need the -u option in this command? - word
    • I think, most likely you just have enough git push. But before that, don't forget git add and git commit - KoVadim
    • and explain for completeness understanding of working with git, let's say I worked with this project test-project and did git push, then someone else made changes to a remote branch. How now to update these changes on a local branch in a cloned test-project? those. How can I copy changes to a local branch from a remote branch? - word
    • git pull origin? right? - word
    • one
      And how is the project "created with the key-u"? maybe just tied a branch? - KoVadim