Created
August 19, 2019 04:58
-
-
Save jankapunkt/53fb29e3d4eb75fc01cc0a3101487608 to your computer and use it in GitHub Desktop.
Initializes a new repo and merges it with a new origin
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
#!/usr/bin/env bash | |
# init repo and initially add all files | |
# ignore should exist before already | |
git init | |
git add -A | |
git commit -a -m "initial files added" | |
# add the new remote and merge them | |
git remote add origin $1 | |
git fetch | |
git branch --set-upstream-to=origin/master master | |
git pull --allow-unrelated-histories | |
git pull --no-edit origin master | |
git push origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment