0

I have some code changes on my remote Ubuntu server. I haven't made any pull/push requests from bitbucket since very long. Now I need all my code that is on my remote server in my bitbucker repo. How do I push this? If I run git pull on my server, I think everything will be messed up. So I need commands to reverse pull to my bitbucket, so my server actually stands for "bitbucket" and the bitbucker stands for as my server. Hope you got it. Sorry for badly organized question.

HTML
  • 93
  • 5
  • Are you looking for [`git push`](https://git-scm.com/docs/git-push), the opposite of pull/fetch? – knittl Oct 05 '22 at 21:32
  • I am not sure I understand you, but what I now want is to connect to my remote server (lets say via terminal). And then type some command which will push all code from this server to its linked bitbucker repo. Is this clarification is okay for you? So basically how its happen. We clone a repo from github and then develop on local, push it to github and then pull on the server. But now, unfortunately I have made a lot of changes on my server manually, using terminal (which was a stupid idea), and I want to make these changes appear on my github or bitbucket, or whatever – HTML Oct 05 '22 at 21:34
  • 1
    So which part is the question? Connecting via terminal? Typing the command? If the command is `git push`? How to link the repos (they must already be linked, how else would have the code on the server been updated in the past)? – knittl Oct 05 '22 at 21:36
  • @knittl, no dude. actually none of them is my question. I mean I need a command which I ll type in my server which will push all code to my git or bitbucket repo. – HTML Oct 05 '22 at 21:38
  • 1
    HTML, so I ask if your question is "do I need to type 'git push' to push my commits"? And your reply is "no, that's not my question, I want to know which command I need to type to push my commits"? Maybe I'm misunderstanding something – knittl Oct 05 '22 at 21:40
  • @knittl, probably its me not understanding bro, sorry. I mean I know its not that obvious ```git push``` commands, so thats why I said no – HTML Oct 05 '22 at 21:43
  • HTML, why do you know it is not `git push`? `git push` is the command to push changes from one PC to your remote (e.g. BitBucket). If you _know_ that `git push` will not work, then please [edit] your question to explain _why_ it doesn't work, ideally showing how you have called it and why the outcome was not satisfactory. I'm pretty sure `git push` is the answer to your question. – knittl Oct 05 '22 at 21:45
  • Oh, really? I mean I thought as my server is a cloned repo. It cannot push vice-versa you know – HTML Oct 05 '22 at 21:46
  • 1
    And what would your local repo on your desktop PC be? It's a cloned repo too and you push from it to BitBucket every day. Every repository "clone" in Git is equivalent (just like a real clone). You can exchange one for any other and will not notice a difference. And as long as there's a network connection between two clones, you can synchronize (i.e. fetch and push) them. – knittl Oct 05 '22 at 21:53
  • @knittl post an answer, he ll accept – Mammadali Mammadaliyev Oct 05 '22 at 22:09
  • 1
    @MammadaliMammadaliyev not posting a new answer to a question that has already been answered several times. – knittl Oct 06 '22 at 06:25
  • @HTML If you disagree about the linked duplicates, please [edit] your question and explain _exactly_ what you have already tried and why the other answers do not work for you (including executed commands, error messages, etc. – every as _text_ and NOT as screenshots) – knittl Oct 06 '22 at 06:43

0 Answers0