X
X
xxx44yyy2019-03-12 14:04:17
git
xxx44yyy, 2019-03-12 14:04:17

How to transfer a project without loss?

There is a project, lies on bitbucket. They gave me an account. I took the project to the local machine and then decided to push, but they tell me that the account has no rights. I climb on bitbucket, and there it turns out that the account with read-access. The person who gave the account feeds the fish and therefore I don’t understand what to do.
I decided that okay, I’ll make myself a separate account and fork the project there. Okay, so I did: I created a new account in bitbucket and then forked that project. It seems everything is normal. However, hello... Now the questions are:
a) how to replace the project in the development environment? I have RubyMine. Didn't find where to poke.
b) how to replace the project without losing the changes made?
As I understand it, I need to somehow replace the link to the repository in RubyMine, but I can’t find something like that and I don’t understand if file changes are lost, because bitbucket doesn’t have anything done on the local machine.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
RidgeA, 2019-03-12
@RidgeA

it was necessary to add 1 more remote to the previous pulled project and push changes to it (you can push the whole thing, including all branches, tags, etc.)
I won’t tell you exactly the commands, but the direction to search for is man git remote, man git push

X
xxx44yyy, 2019-03-12
@xxx44yyy

Everything turned out to be simple, here : https://stackoverflow.com/a/47884691
I just went to VCS -> Git -> Remotes, there I saw one address (the same one, the initial one) and its name is origin. Added my address with name something like blablabla. Then he deleted the original one and set his name to the same as the first one, i.e. origin. I don’t know what the name affects, but I thought it would be better to let it be the way it was.
After that, I did a git push, to which I received a message:

username$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
Okay, then I entered:
And bingo, it worked. Everything seems to be correct, we'll see.

F
FRiMN, 2019-03-12
@FRiMN

b) how to replace the project without losing the changes made?

Option 1: Copy the changed files to the new repository
Option 2: If the commit has already been made and you have git, then read the manual (scroll to "Deleting and renaming remote repositories")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question