Problem:
You must redirect the changes from the local git branch to another remote branch of the git repository, and these changes transferred to the branch will be compared with the wizard existing in the remote URL, and the changes will be merged.
Actions
I still created a local git repository,
Initialized a simple local git repository using below, using the commands as shown below
git init
Existing files are added to the repo and added to the staging area using the following command:
MacBook-Pro: $ git add *.h MacBook-Pro: $ git add *.m
Checked status using the command below,
MacBook-Pro: $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # new file: test.h # new file: test.m #
Consider
git commit -m"Added test base files"
Now created a new branch named issue_fix,
MacBook-Pro:$ git branch issue_fix
Work on the branch will begin by checking the branch.
MacBook-Pro: $ git checkout issue_fix
A few commits were made to the branch. Everything was OK.
Now I’m in a situation where I need to push the changes that I made to the "issue_fix" branch to the URL of the remote repository, for example this
https:
My changes will be redirected to the branch name indicated to me, or if the branch was not available, I need to create a remote branch and push my changes to the local branch on it.
The most important shifted changes will be compared with the master in the specified repository URL, and if everything goes well, it will be merged with the master. Therefore, I will always redirect my changes only from local to remote.
The problem arose because the Clone URL was not specified when I started from this, only the source was provided, so I created a local git repository and started working on it, now the repository URL was specified and asked to click mine changes to the branch.
I would like to know if this is possible in the first case? If possible, give me the commands I need to give in order to make it work.