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