I thought it was source trees version of "update from main" by the fact its trying to push changes onto main that was an incorrect assumption I have not pushed the changes how do i remove the changes it is now trying to push?
I currently have 5 things trying to be pushed onto main how do I get it to just forget about everything and give me whatever the remote thinks main is right now and nothing else I do not care about losing any work on my end
I currently have 5 things trying to be pushed onto main how do I get it to just forget about everything and give me whatever the remote thinks main is right now and nothing else I do not care about losing any work on my end
Hi @s and welcome to the community!
If I understand correctly, you want your local branch main to point to the commit that the remote branch main points to.
You said you don't care about losing work. However, I still recommend you save the current state of local main into a new branch, in case you change your mind later. The last command in the steps I provide below includes a destructive operation, so it's best to have a backup of main.
You can do the following:
1. Open a terminal application and navigate to the clone directory.
2. Run
git status
to check which branch you are currently on.
If it is not main, run
git checkout main
3. Run
git status
again. If there are changes you haven't committed yet, add them and commit them.
4. Create a new branch out of main so that you don't lose any work, with
git branch some-branch-name
where some-branch-name replace with the name you want for the new branch.
5. Run the command
git remote -v
The output will show you the name and URL of the remote, e.g.:
origin git@bitbucket.org:workspace-id/repo.git (fetch)
origin git@bitbucket.org:workspace-id/repo.git (push)
If the name of your remote is origin, fetch changes from the remote repo with
git fetch origin
6. Double check again that you are on the local main branch by running git status and checking the output. If you are, then run
git reset --hard origin/main
If you have followed all the steps and your currently checked out branch is main, the last command is going to make your local main point to the same commit as the remote main.
Please feel free to reach out if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
work on local is easy to re-implement the hard part was working it out but I have my implementation notes (and the changes were on the other branch I was trying to update to be in line with main anyway)
got it sorted though
someone else on my team had me just delete the local copy of main (with force delete) and then just checkout main again and that got rid of all the changes that were trying to be pushed to main without pushing them to main
I then just merged main into my branch (merge main into current branch) at their instruction sorted out the one conflict and It was all sorted
I may have panicked a bit though
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the update, it's good to hear that you got it sorted.
Please feel free to reach out if you ever need anything else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.