Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Gokking the Git
# deletes the local remote-tracking branch, but not the actual remote branch
git branch -rd origin/[branch name]
# To delete the actual remote branch
git push origin --delete [branch name]
# had a need to merge existing repo into a newly created repo without loosing history or either
# given repo A (new repo), and repo B (existing repo)
git clone A
git clone B
cd A
git remote add B ../B
git fetch --all
git merge --allow-unrelated-histories B/master
# will overwrite any existing master branch
git push -f origin master
# push local branch to remote with tracking
git push -u origin [branch name]
# for existing branch
git branch -u [origin]/[branch name]
git merge --squash [branch name]
git commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment