M
M
Maxim Uglov2018-04-20 21:42:22
git
Maxim Uglov, 2018-04-20 21:42:22

How to sync uploaded project with Bitbucked repository?

I uploaded a folder with a project from bitbucked, after that I wanted to link it to the repository where it was downloaded from and already make edits, commit and so on.
First, don't clone because of the traffic. Now it's a matter of principle to figure out how to do it. In theory, everything should be just an exact copy, there are all accesses, the manuals have been read, but it’s impossible to link, then the error
git did not exit cleanly (exit code 1) then
git did not exit cleanly (exit code 128)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daniel, 2018-04-21
@Dyaminigo

Initialize the local repository in the folder of the downloaded project:
git init
Add a remote repository:
git remote add origin https://bitbucket.org/username/reponame.git
Pull remote commits/branches to yourself:
git pull origin
Link the local master branch to the remote branch:
git branch --track master origin/master Pull
the remote commits/branches back to us (if something didn't work the first time):
git pull origin
-----
repo with remote. But situations are different, so if something didn’t work out for you, describe in more detail the errors that occur, your actions, etc.

M
Maxim Uglov, 2018-04-22
@Vencendor

In general, the answer is no.
You can create a new repository locally, link it to a remote one, and try to sync.
The mistake I was doing was not adding all the files in the folder to the repository - "git add . ". Therefore, pull or fetch operations throw an error.
Well, the answer to the main question vserovno - no way. Even if the files are added and there are no changes to them, the state of the local repository is different from the remote one. In order for git to check that the local files are the same as on the remote, it will need to download them all the way. That is, the traffic will be spent all the time, twice.
The only option is to download from someone who has already cloned the project only the .git folder and already try to fool around in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question