Cover graphics_Git

刘邦和项羽是什么关系

Bob Reselman
English
百度 关中地区本来就是一个经济区,这个经济区面积不大。

Download Cheat sheet

About

Cheap local branching, convenient staging areas, and multiple workflows are just a few of the features Git offers.  As an open source distributed version control system, there are many ways to use Git. The good news is getting started is easy.

This cheat sheet explains basic Git concepts and workflow and guides you through the processes for moving content to and from the remote repository. You’ll also learn how to merge files between branches, rebase files between branches, and invoke the  diff tool when merge conflicts occur.

Download the Git Cheat Sheet and learn commands around:

Working with repositories

  • git init
  • git clone
  • git pull
  • git fetch
  • git log

Working with branches in Git

  • git branch -r
  • git branch -a

Working with content

  • git status
  • git add
  • git commit
  • git push
  • git restore
  • git clean

Rolling back commits

  • git revert
  • git merge
  • git rebase
  • git mergetool
  • git blame
  • git tag

With Red Hat Developer cheat sheets, you get essential information right at your fingertips so you can work faster and smarter. Easily learn new technologies and coding concepts and quickly find the answers you need.

怹是什么意思 大腿内侧肌肉叫什么 洋芋是什么东西 脚磨破了涂什么药 鼻头出汗是什么原因
墨龟为什么只能养一只 血糖是什么 心理健康是什么 郁闷什么意思 为什么总是梦见一个人
月季花什么时候开 龙日冲狗煞南是什么意思 检测毛囊去什么医院 副连长是什么军衔 憩室是什么意思
经常放屁什么原因 鲱鱼是什么鱼 黄芪煲汤和什么搭配 咽炎吃什么 心脏彩超能查出什么
藜麦是什么东西liaochangning.com 血红蛋白低吃什么hcv9jop3ns4r.cn 零点是什么hcv9jop0ns8r.cn 乙肝两对半和乙肝五项有什么区别hcv9jop0ns3r.cn 122是什么号码hcv9jop3ns0r.cn
三拜九叩是什么意思hcv8jop9ns5r.cn c60是什么hcv8jop9ns4r.cn 寅时属什么生肖hcv8jop2ns1r.cn 冥王星是什么星jiuxinfghf.com 龙的本命佛是什么佛hcv7jop6ns3r.cn
指导是什么意思hcv8jop1ns3r.cn 2025是什么年zhiyanzhang.com 什么是低密度脂蛋白胆固醇hcv7jop9ns7r.cn 3月26日是什么节日fenrenren.com 笑死是什么意思hcv8jop0ns3r.cn
什么是盆底肌hcv8jop6ns4r.cn 棘手是什么意思hcv9jop0ns1r.cn 医保和农村合作医疗有什么区别hcv8jop4ns2r.cn 呼吸困难吃什么药hcv9jop0ns1r.cn 睡醒咳嗽是什么原因hcv8jop9ns3r.cn

Excerpt

Rolling back to the most recent commit

The following sections describe how to merge files between branches, rebase files between branches, and invoke the  difftool when merge conflicts occur.

Example:

The following example shows the current branch as well as the files in that branch. The dev branch has two files,  newfile.txt and readme.md .

Then the branch is changed to main. The main branch has one file, readme.md . The command git merge dev --no-edit merges the files from the dev branch into the the current main branch. The option  --no-edit is used to avoid having to write a message describing the merge. Finally, the  ls -1 command shows that the merge successfully added  lnewfile.txt from the dev branch to main:

Merges the files and directories from <branch_to_merge_from> into the <target_branch>. If the <target_branch> parameter is not provided, the files and directories in the <branch_to_merge_from> are merged into the current branch.

$ git branch
* dev
main
$ ls -1
newfile.txt
readme.md
$ git checkout main
$ ls -1
readme.md
$ git merge dev --no-edit
Merge made by the 'recursive' strategy.
newfile.txt | 0
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 newfile.txt
$ ls -1
newfile.txt
readme.md

git rebase

git clean [options] <filename> git rebase [options] <other_branch>

Merges one repository onto another while also transferring the commits from the merge-from branch onto the merge-to branch. Operationally, Git can delete commits from one branch while adding them to another.

Example:

The following example checks out the branch dev and then rebases the updates made in the branch new_feature onto the branch dev. The commits that were part of new_feature are now part of dev:

$ git checkout dev
Switched to branch 'dev'
 
$ git rebase new_feature
Successfully rebased and updated refs/heads/dev.