- Init an empty repository.
- add remote, using
http
or ssh
method
- origin is just a naming for your remote
1
| git remote add *origin* {url}
|
- reset everything to your online repository
- –hard will delete all your local changes!
1
| git reset --hard *origin*/{branch_name}
|
1
| git checkout {branch_name}
|
- pull from remote, might need to fix commits
- rebase, add in changes and align with commit dates
- merge, add a merge commit message to show all the changes
- stage all your changes, add . is stage all changes, you can add specific if needed
- commit your staged changes
1
| git commit -m "{commit_message}"
|
- push your commits to online repo
1
| git push origin {branch_name}
|
I actually prefer using git client such as Fork, so you can get rid of all these commands