How to delete/change the remote origin master branch - eclipse

I have a movile project repo in bitbucket and I cloned that repo into a eclipse project the remote branch master/origin point too that repo this is ok, but I created another empty repo in bitbucket and I want to push my project in that empty repo.
My problem is that when I do git remote -v it shows the name of the branches of the repo from were I cloned the project, I want to remove those branches and change them to use the branches of the new empty repo that I created

You can change remote of the repo to point to a different URL:
git remote set-url origin git#bitbucket.org:<your_id>/<new_repo.git>

Related

local git repository with two remote git repositories

On my local git repo, I used to push it to two different remote repo, one on github and another on heroku. Now my local is stuck on heroku repo and I want to create a branch from github master branch. How can I change from heroku to github(origin)?
[thi is what my terminal looks like]
See here - you want to set your local branch to track a different remote: Make an existing Git branch track a remote branch?

Cloning a github repo into an existing project?

I have a project in Eclipse that I want to put on github, so I went to github and created the repos for them, but I want to clone them right into the folder where the files are stored in my eclipse workspace. How can I do this?
EDIT: When I try it, the github app says it can't clone because the folder isn't empty.
EDIT 2: Will this work? Changing the name in eclipse to rename the project folder, then cloning the repo to the name I want, in the workspace, then renaming the eclipse project so they merge and I can commit the new files.
GitHub has a guide explaining how to put an existing project on GitHub.
You should not clone the repository, but add the GitHub repository as a remote to a local repository you create yourself.
Go to your project folder and initialize a local repository with git init
Add and commit all your project files to the local repository. (e.g. git add . and git commit -m "message")
Add the GitHub repository as a remote. git remote add origin *github repository URL* (Verify with git remote -v)
Push your project to GitHub with git push origin master.
If you already have committed files to the GitHub repository, it is still possible.
Initialize your local repository.
Add GitHub as the remote.
Pull from GitHub.
Add and commit your project.
Push you project to GitHub
First add the remote as follows
git remote add origin <GIT URL>
Then simply do the following (MAke sure to commit any of your local files)
git pull --allow-unrelated-histories

push new git branch to remote repo on eclipse

I can't find the answer anywhere...
I created a local branch from my master branch on my local repo.
Now, I want to push my branch to bitbucket (my master branch is already syncing fine)
How can I do that? (I don't have EGit, I can't download it for some reason)
with Git Bash do :
git push origin "your-name-of-branch"
This command push your origin (local branch) into remote "your-name-of-branch". If "your-name-of-branch" doesn't exist, create it

Everything Up to Date but really isn't github

I git cloned a repo down to my local machine.
I forked that repo to my github account.
I made changes in my local files in sublime
I removed the original repo's origin because I want to push to my now forked repo
and then continue to alter my local files
when I do git diff you see the files I altered
when I do git remote -v I successfully see my forked repo
when I do git push -u origin master I get Everything is up to date but it isn't ...
and when I do git branch I am in my master branch.
You need to git commit, then push the new commit to your remote repository.
git diff compares the files on disk to what git is tracking; git push compares what git is tracking locally to the remote.

switching remotes in github

Can we switch to different remotes in github I have two remotes
upstream (main repo)
origin (mywork)
Accidently, i created clone of upstream and created branches and worked in it. I want to miove all changes made to upstream's test branch to origin and also switch to origin. Now when ever I create a branch it is created in origin
Please suggest.
Considering those are the same repo (or at least repos with a common history), you can:
clone the other GitHub repo 'origin' 'mywork'on your computer
add the first repo (the 'upstream' cloned one locally) as a remote (git add remote upstream file:///path/to/main/repo)
fetch everything and create local branches out of the remote branches
push everything back to your origin 'mywork' repo