Last active
May 24, 2017 11:59
-
-
Save hasantahir/c6f5f74e08f34ea91a0decf1fbdf9c81 to your computer and use it in GitHub Desktop.
Working with Git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To sync local repo with the remote simply use the git pull command