How to create and commit a branch in gitlab

This is meant as a question that I am answering for other people. However, if someone answers this question before completing their research, I would appreciate it.

How can I transfer the existing git repository to which I have access to the developer from the shell, edit it, copy these changes, and then move it to the server for verification before merging.

EDIT

Please note that this is not my project, but someone else's. This use gave me access to do some work. When everything is done, I will ask them to merge the changes back to the original

+5
source share
2 answers

To set up your repo you will need to follow these instructions . Then you will need to clone / deploy an existing repo like this .

Then make changes. Once you are done making your changes. You will need to do a β€œcommit” that looks like this:

git commit -m "I changed something somewhere" 

Then you will want to remove any changes from the repo that may have been pressed during operation.

 git pull origin master // master being the branch that you cloned/forked 

Once the craving ends without conflict, you can click on your changes.

 git push origin master // this is saying that you want to replace the remote master branch with your local master branch 

EDIT To click on a repo without overwriting the wizard, do the following:

 git clone //clone what branch you want git checkout -b new_branch //this will create a new local branch git push origin new_branch //this will create a new origin branch 
+5
source

If I understand your question correctly:

  • You do not have permission to click on the repository
  • You want to create a branch, make some commits, and then offer a merge request

This is actually a completely normal situation, here's what to do:

  • In a GitLab fork project: this creates a clone of the source repository in your personal workspace. The fact is that you can click on your personal workspace.

  • On your computer, clone from a fork, not the original.

  • Create a branch ( git checkout -b myfeature ), make changes and commit, then push this branch to your fork ( git push -u origin HEAD )

  • In GitLab, go to the page with the fork and a button should appear next to it asking you to create a merge request from the branch you just clicked. Click on it, review the changes if they look good, then install the assignee and click Create. The assignee should receive an email notification

You do not need write access to the project so that it can contribute. All your recording operations are at the workplace in GitLab and on your local PC. Reviewers of your merger request may accept or reject it at their discretion. They may also ask you to make improvements that you can implement and click (a simple git push after local commits) that updates the merge request (reviewers can reload the page in the browser and see your changes).

0
source

All Articles