Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

How to Integrate local Git Repo with Remote Git Repo?  RSS feed

 
Ranch Hand
Posts: 1611
13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I have a project that has not been "Cloned" from a remote Git repo, but it uses Git locally for commits and such, how do I get that project into a (possibly new) remote repo?

Do I first need to create an empty project in the remote repo and do a push from the local project? That idea doesn't seem to jive with how you have to clone the remote repo initially.

I am just not sure of this particular workflow: you have a local Git repo, but you want to integrate it with a remote Git repo like on GitHub or wherever so you can also do push(es).

Thanks in advance,

-mike
 
author and jackaroo
Posts: 12197
279
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally you would create the remote repository, then add the origin, and then push.

For example, if I had created a repository called andrewplay on git.example.com (not a real repository location), I would then run the following commands in my local directory:


 
Mike London
Ranch Hand
Posts: 1611
13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Andrew Monkhouse wrote:Normally you would create the remote repository, then add the origin, and then push.

For example, if I had created a repository called andrewplay on git.example.com (not a real repository location), I would then run the following commands in my local directory:




Thanks much. I'm assuming I can do all this from Tower (Git GUI for mac).

Appreciate your reply.

-mike
 
Andrew Monkhouse
author and jackaroo
Posts: 12197
279
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never used Tower. However they claim: "Easily create, delete and rename branches, tags, and remotes". Given that, it sounds like you should be able to add your remote then push the project.
 
Mike London
Ranch Hand
Posts: 1611
13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Andrew Monkhouse wrote:I've never used Tower. However they claim: "Easily create, delete and rename branches, tags, and remotes". Given that, it sounds like you should be able to add your remote then push the project.



Thanks Andrew.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean force to two repo be the same version, you can add "-f" to push
 
Mike London
Ranch Hand
Posts: 1611
13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Wade Zhang wrote:If you mean force to two repo be the same version, you can add "-f" to push



Wow, a response four years later! Thanks, man.

I still have Tower, but I now just use Git via the IDE. So much easier and only one program to worry about.

Thanks again for your posting.

- mike
 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!