Skip to content

Instantly share code, notes, and snippets.

@hasantahir
Last active May 24, 2017 11:59
Show Gist options
  • Save hasantahir/c6f5f74e08f34ea91a0decf1fbdf9c81 to your computer and use it in GitHub Desktop.
Save hasantahir/c6f5f74e08f34ea91a0decf1fbdf9c81 to your computer and use it in GitHub Desktop.
Working with Git
I have messed many times syncnig local repos with remote ones. To avoid that in future, following is a short procedure that I need to follow.
1. If work has been started locally, start with the Gist with instructions on how to upload the local repo to Github.
2. If work has been started remotely,
First step is to clone the remote repo locally:
Once the local repo is initialized an synced with remote:
git init
git remote add <origin>
git clone
The above command creates a local clone of the remote repo that can be worked on the PC offline.
The changes made can finally be pushed back to the remote repo
git push origin master
@hasantahir
Copy link
Author

To sync local repo with the remote simply use the git pull command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment