cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
232
Views
0
Helpful
2
Replies

Github - push files from local repo to remote repo by using generated

Netmart
Level 1
Level 1

Hello,

Could someone please advise on the best practice how to push local repo to remote repo [Github].

 

Thanks,

 

 

2 Replies 2

Marcel Zehnder
Spotlight
Spotlight

Hi @Netmart 

Just google for "git tutorial" or "github tutorial" there are plenty of free resources available (for example https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners).

Assuming you want to push from your local remote to your remotes repo main branch:

cd /path/to/your/local/repo

git add .
git commit -am "some message describing your changes"
git push -u origin main

 

Jesus Illescas
Cisco Employee
Cisco Employee

When working with a remote repo such as GitHub or Gitlab, what I always do is to create the repo there first. Once the repo is done, I clone it and start working locally. Once I have my changes done, I push them.

You could do the same in other ways, but this is the flow that works for me. I don't need to git init and then when pushing specifying the origin and main (vscode takes care of that for me).

So I recommend, explore several ways and stick to the one method you find easier.

As a tip, remember to always work with branches. Don't push to your main branch, prefer merge.