The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

    • @redrapids Factorial calculator. 58 minutes ago
    • RT @ZusterMerel: Echt, kan het iemand nog schelen? Same shit, different day. En over 2-4 jaar weer dezelfde verkiezingen met een waardeloze… 1 hour ago
    • RT @isotopp: Dreizig Milliarden Euro kostet der Wiederaufbau nach der Flutkatastrophe im Ahrtal, und die weggespülten Häuser sollen nicht a… 1 hour ago
    • RT @aliettejonkers: "Hospital infection study shows use of FFP3 respirators at Addenbrooke’s ‘may have cut ward-based infection to zero’" 1 hour ago
    • RT @isotopp: InfraCGI zeigt Euch andere Straßen. Wandel ist möglich. Farbe reicht nie. Dem Auto muß in der Stadt Platz entzogen werden. 1 hour ago
  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,469 other followers

version control – How do I do an initial push to a remote repository with Git? – Stack Overflow

Posted by jpluimers on 2020/04/30

Based on [WayBack] version control – How do I do an initial push to a remote repository with Git? – Stack Overflow, this is what I do:

On the server

mkdir my_project.git
cd my_project.git
git --bare init

On the client

mkdir my_project
cd my_project
touch .gitignore
git init
git add . git
commit -m "Initial commit"
git remote add origin
git push --set-upstream origin master

The last one is important, especially when you have multiple remotes.

Some servers allow you to skip the server part, as they run them automatically when pushing a new repository from the client.

This can be both an advantage and a disadvantage, for instance when you have typos when adding the remote.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: