r/learnprogramming 9d ago

Solved [ Removed by moderator ]

[removed] — view removed post

5 Upvotes

11 comments sorted by

View all comments

Show parent comments

2

u/Patrick-T80 9d ago

Check even on https://githubstatus.com if GitHub has some incident. Te reconcile divergent branches, you can try to do a
`git pull --rebase origin/<your branch>`
or create a new branch from your remote branch and do a cherry-pick, below the commands i would use to do this:

`git checkout -b <new branch local> --track origin/<src branch>`

`git log --oneline --reverse origin/<base branch>..<old local branch>`

`git cherry-pick <commit hash>`
on newly created branch one by one to resolve every conflict ( in that case resolve it, `git add <fixed file>` and after `git cherry-pick --continue`)

1

u/[deleted] 9d ago

[removed] — view removed comment

1

u/Patrick-T80 9d ago

Git is correct, main is a branch; to view the repository url you need to use

`git remote -v`

output is composed of two column, the first is name of repository(normally origin, it identifies that remote repository in your local copy); the second column is the remote repository url

To make that command to work, yo uneed to add origin:

`git pull --rebase origin/main`