我也玩玩git,常用命令

我也玩玩git,初入,本屌还是处在一头雾水,不知如何来玩git的阶段,下面先列一些常用的命令及git客户端安装

安装

rpm -qa |grep git   查看是否安装git

yum list | grep ^git  查看列表

yum install git-all.noarch

git version

把自己介绍给git

git config --global user.name "xf"

git config --global user.email "[email protected]"

导入一个新的项目,举例这个项目名jpro 下有一个a.txt源文件

cd /home/zwf/git_study/jpro

git init

ls -al

git add .

git commit   #会出现vi界面 写入注释内容

查看修改内容

git diff -cached

git diff

git status #获取整体改动的状态

“# Changed but not updated:”  已经修改未git add

git add a.txt

git status

“# Changes to be committed:” 已经git add 未 git commit

git log

git commit -a 可以提交所有修改过的文件省去add  commit 但是新增的文件不行

克隆gitweb上的项目

git clone http://tp:8080/git/test.git

git有 本地协议 [email protected]协议 ssh协议 http、https协议

git在windows上也有客户端需要先安装msysgit,在安装TortoiseGit,眼熟吗Tortoise,曾经svn专属啊。

时间: 2024-08-10 02:11:30

我也玩玩git,常用命令的相关文章

【前端小小白的学习之路】Git常用命令整理

Git 常用命令清单. 几个专用名词的译名如下: Workspace:工作区 Index / Stage:暂存区 Repository:仓库区(或本地仓库) Remote:远程仓库 一.新建代码库 # 在当前目录新建一个Git代码库 $ git init # 新建一个目录,将其初始化为Git代码库 $ git init [project-name] # 下载一个项目和它的整个代码历史 $ git clone [url] 二.配置 Git的设置文件为.gitconfig,它可以在用户主目录下(全局

git常用命令2

git常用命令2 添加远程仓库(以github为例) 登录官方网站https://github.com,没有的话去注册一个账号吧. 然后新建一个仓库 在Repository name填入learngit,其他保持默认设置,点击"Create repository"按钮,就成功地创建了一个新的Git仓库: 目前,在GitHub上的这个learngit仓库还是空的,GitHub告诉我们,可以从这个仓库克隆出新的仓库,也可以把一个已有的本地仓库与之关联,然后,把本地仓库的内容推送到GitHu

iOS开发——开发技巧&Git常用命令

Git常用命令 初始化git init        加—bare实现远程仓库 配置git config user.name iCocos 配置全局git config —global user.name iCocosgit config —global user.email [email protected] 状态git status 添加到帮派git add iCocos.m 提交git commit iCocos.m -m “注释” Log纪录git loggit log + 文件名git

git常用命令符

全局配置 $ git config --global user.name "姓名" 告诉git你是谁 $ git config --global user.email "[email protected]" 告诉git怎么联系你 如果注册了 github 账号,邮箱最好和 github 账号统一 $ git config -l 查看配置信息初始化代码仓库 $ git init 初始化代码库 $ git add . 将所有变化添加到暂存区 $ git commit -

(小组)Git 常用命令整理

Git 常用命令整理 取得Git仓库 初始化一个版本仓库 git init Clone远程版本库 git clone [email protected]:wordpress.git 添加远程版本库origin,语法为 git remote add [shortname] [url] git remote add origin [email protected]:wordpress.git 查看远程仓库 git remote -v 提交你的修改 添加当前修改的文件到暂存区 git add . 如果

github创建远程仓库和git常用命令

git创建远程仓库 首先到github页面上创建仓库(repository)如下: 然后初始化文件夹为仓库,并提交到远程仓库,如下: [[email protected] aa]# git init Initialized empty Git repository in /data/mydata/aa/.git/ [[email protected] aa]# git add . [[email protected] aa]# git commit -m "first commit"

Git 常用命令集锦

远程仓库相关命令 克隆远程仓库:git clone git://github.com/jquery/jquery.git 查看远程仓库:git remote -v 添加远程仓库:git remote add [name] [url] 删除远程仓库:git remote rm [name] 修改远程仓库:git remote set-url --push [remoteName] [newUrl] 拉取远程仓库:git pull [remoteName] [remoteBranchName]:[l

windows下安装git并创建一个仓库,git常用命令

转载于:http://www.cnblogs.com/nemotan/p/4655498.html 一.windows安装git 1.下载:http://msysgit.github.io/,下载之后直接安装,打开gitbash 2.配置用户名和邮箱: $ git config --global user.name "Your Name" $ git config --global user.email "[email protected]" 3.新建一个文件夹并执

git常用命令及技巧

强推,即利用强覆盖方式用你本地的代码替代git仓库内的内容 git push -f git fetch --prune  #这样就可在本地删除在远程不存在的branch man git-fetch --prune After fetching, remove any remote tracking branches which no longer exist on the remote. -t, --tags Most of the tags are fetched automatically

Git 常用命令速查

一. Git 常用命令速查 git branch 查看本地所有分支 git status 查看当前状态 git commit 提交 git branch -a 查看所有的分支 git branch -r 查看远程所有分支 git commit -am "init" 提交并且加注释 git remote add origin [email protected]1.119:ndshow git push origin master 将文件给推到服务器上 git remote show or