git基本命令
来源:互联网 发布:孤岛惊魂3 优化 编辑:程序博客网 时间:2024/06/13 07:27
1.git diff + filename
2.git log
3.git diff 查看修改情况
4.git reset filename
5.Git enables you to rewind to the part before you made the wrong turn and create a new destiny for the project. You can do this with:
git reset SHA
This command works by using the first 7 characters of the SHA of a previous commit.
For example, if the SHA of the previous commitis 5d692065cf51a2f50ea8e7b19b5a7ae512f633ba, use:
gitreset 5d69206
6.git checkout HEAD filename
: Discards changesin the working directory.
git reset HEADfilename: Unstages file changes in the staging area.
git reset SHA: Can be used to reset to a previous commit in your commit history.
7.Additionally,you learned a way to add multiple files to the staging area with a single command:
git addfilename_1 filename_2
8. You can use the command below to answer the question:“which branch am I on?”
git branch
9. To create a new branch, use:
git branch new_branch
10. You can switch to the new branchwith
git checkout branch_name
11. We can easily accomplish this by merging the branch into masterwith:
git merge branch_name
12.
git branch -d branch_name
will delete the specifiedbranch from your Git project.
13.
it clone remote_location clone_name
In this command:
· remote_location tells Git where to go to find theremote. This could be a web address, or a filepath, such as:
/Users/teachers/Documents/some-remote
· clone_name is the name you give to the directoryin which Git will clone the repository.
14.
You can see a list of a Git project's remotes with the command:
git remote -v
15.An easy way to see if changes have been made to the remote and bring the changes down to your local copy is with:
git fetch
This command will not merge changes from the remote into your local repository. It brings those changes onto what's called a remote branch.
16. Now we'll use the git merge
command to integrate origin/master
into your local master
branch. The command:
git merge origin/master
17.
git push origin your_branch_name
will push your branch up to the remote, origin
.
- 【Git】Git基本命令①
- GIT基本命令
- git 基本命令介绍
- git 基本命令
- git 基本命令介绍
- git 基本命令使用
- git 基本命令
- git 基本命令
- Git基本命令
- Git基本命令整理
- git基本使用命令
- Git操作基本命令
- git基本命令
- git基本命令
- git 基本命令介绍
- Git 基本命令
- git 基本命令
- git常用基本命令
- 对2.4G的初步了解
- typedef与using、struct与class的区别
- HDU 5927 Auxiliary Set (树形DP+思维)
- qt5.7交叉编译开发板开机运行程序
- 日常工作总结(只读文件系统故障解决)
- git基本命令
- spring常用注解
- 【任务】船舶轨迹拟合成为矢量化表达形式
- android官方文档代理网站还挺快的
- 在本地环境配置本地可用的域名站点
- 离散对数(例题+详解+代码模板)
- HDU Mr. Frog’s Problem 2016CCPC东北地区大学生程序设计竞赛 - 重现赛
- python 类与实例
- tomcat-异常汇总