OpenStack git cmd

Source: Internet
Author: User

1. Create a branch

Branching is the act of creating a standalone version of your code, independent of your trunk branch. By default, every file you commit to Git will be stored in the "Master (Trunk)" Branch.
Now let's say you want to add a feature to the project, but you want to be able to roll back to the current version in case something goes wrong, or you decide to give up the feature. This is the time for you to create a branch.

Create and switch to your new branch command at the same time:

  Git checkout-b new_feature

Alternatively, you can first create a branch and then manually switch:

Git branch new_feature

git checkout new_feature

2. View Current Branch status

git status

3. Add the current branch code to the local

git add *

4. View the version's log record

git log

5. View the configuration of git

git config--list

Git config-l

user.name=xiangxinyong
[email protected]
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://git.openstack.org/openstack/murano
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
Branch.master.remote=origin
branch.master.merge=refs/heads/master
remote.gerrit.url=https://xianxinyong:[email protected]/ Openstack/murano.git
remote.gerrit.fetch=+refs/heads/*:refs/remotes/ gerrit/*

6. modifying git configuration items

git config--global user.name xiangxinyong

7. Add or modify a git message

Add:git commit-a-F git/message  

Modified:git commit--amend-a-f git/message

8. Installing Git-review

Apt-get Install Git-review

9. Add to Gerrit

First, you need to log in to review.openstack.org, and then in HTTP password, settings, generate an HTTP password, which should be a random string of uppercase and lowercase numbers.

Git remote set-url Gerrit https://username:[email protected]/openstack/nova.git command to modify SSH to HTTPS mode, of course, you can also use HTTP

Git remote add Gerrit https://username:[email Protected]/openstack/nova.git

Note: The username/password in the above string is changed to your Gerrit user name and the HTTP password generated in the previous step.

OpenStack git cmd

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.