Git初始化项目 和 Gitignore

初始化init:

git init

git status

git add .

git commit -am "init projrct"

添加远程仓库:

git remote add origin [email protected]:liuge36/mmall.git

推送:

git push -u -f oragin master

查看远程分支:

git branch -r

采用分支开发 主干发布:

git checkout -b V-1.0 origin/master

当前分支:

git branch

把当前的分支推送给远程的分支:

git push origin HEAD -u

=================================================

查看使用的传输协议:

git remote -v

重新设置成ssh的方式:(gitalb 码云 github应该都是类似的操作)

git remote rm origin

git remote add origin [email protected]:liuge36/MyFirstTest.git

git push -u origin master

重新设置成http的方式:

git remote rm origin

git remote add origin http://gitlab.qiziqi.xyz/liuge36/MyFirstTest.git

git push -u origin master

这里接下来就是输入自己的gitlab的用户名和登录密码

================================================

Command line instructions

Git global setup

git config --global user.name "liuge36"

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

Create a new repository

git clone [email protected]:liuge36/MyFirstTest.git

cd MyFirstTest

touch README.md

git add README.md

git commit -m "add README"

git push -u origin master

Existing folder

cd existing_folder

git init

git remote add origin [email protected]:liuge36/MyFirstTest.git

git add .

git commit -m "Initial commit"

git push -u -f origin master

Existing Git repository

cd existing_repo

git remote rename origin old-origin

git remote add origin [email protected]:liuge36/MyFirstTest.git

git push -u origin --all

git push -u origin --tags

================gitignore========================

*.class

#package file
*.war
*.ear

#maven
target/

#eclipse ignore
.settings/
.project
.classpatch

#idea
.idea/
/idea/
*.ipr
*.iml
*.iws

#temp file
*.log
*.cache
*.diff
*.patch
*.tmp

# system ignore
.DS_Strore
Thnmbs.db

原文地址:https://www.cnblogs.com/liuge36/p/9882822.html

时间: 2024-08-03 10:32:18

Git初始化项目 和 Gitignore的相关文章

Git:初始化项目、创建合并分支、回滚等常用方法总结

Git 初始化项目 创建新的Git仓库 echo "# git_project" >> README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/cjunn/git_project.git git push -u origin master 提交记录 git add . 或者 git add test

git+webpack项目初始化

目录结构 src + page view image service util git初始化 linux常用命令 rm -rf mmall-fe/ 删除 mkdir mmall-fe 创建文件夹 ls -al 显示所有文件 cd .. 返回上一级 cat text.html 查看文件内容 rm -rf dist/ 删除文件夹(所有内容) rm text.html 删除文件 touch test.json 创建一个test.txt文件 ls -b 显示文件列表 vim index.html 创建并

利用git将项目上传到github

本文主要介绍如果用git将项目上传到githup. 一.准备工作 (1)欲将项目上传到githup,先在githup上新建一个仓库.这里就不介绍. (2)安装git,这里也不介绍. 二.开始上传 (1)进入到项目文件夹,调出git命令窗口,初始化仓库 git init (2)添加远程仓库 git remote add origin URL                   这个URL是刚刚创建的仓库地址 git remote add origin https://github.com/zxy1

eclipse使用git提交项目

准备工作: 目的:eclipse使用Git提交本地项目,提交至远程github上 eclipse版本:eclipse4.5  64位 jdk版本:jdk-1.7 64位 项目类型:maven web项目 备注:eclipse高版本自带git插件,而低版本则需自己安装git插件,这里使用eclipse高版本,低版本安装git插件这里不进行介绍. eclipse使用git提交项目有2种方式:一种是git命令窗口,另一种是eclipse自带git插件(跟svn插件一样使用) 一.使用git命令窗口提交

不用copy代码--eclipse使用git提交项目-转

原文地址:http://blog.csdn.net/u014079773/article/details/51595127 准备工作: 目的:eclipse使用git提交本地项目,提交至远程github上 eclipse版本:eclipse4.5  64位 jdk版本:jdk-1.7 64位 项目类型:maven web项目 备注:eclipse高版本自带git插件,而低版本则需自己安装git插件,这里使用eclipse高版本,低版本安装git插件这里不进行介绍. eclipse使用git提交项

git初始化

首先在github上Create a New Reposity 然后初始化一下git,首先files---settings-----Terminal中设置 terminal中进行命令操作 使用touch README.md命令创建文件 同理生成.gitignore文件,在文件里添加忽略要素 *.class #package file*.war*.ear #kdiff3 ignore*.orig #maven ignoretarget/ #eclipse ignore.settings/.proj

Git忽略规则及.gitignore规则不生效的解决办法

Git忽略规则及.gitignore规则不生效的解决办法 在git中如果想忽略掉某个文件,不让这个文件提交到版本库中,可以使用修改根目录中 .gitignore 文件 的方法(如无,则需自己手工建立此文件).这个文件每一行保存了一个匹配的规则例如: # 此为注释 – 将被 Git 忽略 *.a       # 忽略所有 .a 结尾的文件 !lib.a    # 但 lib.a 除外 /TODO     # 仅仅忽略项目根目录下的 TODO 文件,不包括 subdir/TODO build/   

Git?本地项目上传至托管平台(OsChina/GitHub)

为了方便自己的代码管理,通常是把自己的写的一些小项目分享到GitHub 或者git.oschina上面! 区别: GitHub 只能创建公开的项目,国外的,速度慢! git.oschina 开源中国的代码托管平台,可建私有的,国内的,速度快!一,准备工作: Git 客户端安装:下载git 客户端,并安装! 附:下载地址:git客户端 ,安装教程! 在oschina/GitHub创建账号并创建项目! 然后,就得到了远程仓库的url: https://git.oschina.net/ut2002/W

谈谈Git的忽略规则.gitignore

对于经常使用Git的朋友来说,.gitignore配置一定不会陌生. 今天就来说说这个.gitignore的使用. 首先要强调一点,这个文件的完整文件名就是“.gitignore”,注意最前面有个“.”.这样没有扩展名的文件在Windows下不太好创建,这里给出win7的创建方法: 创建一个文件,文件名为:“.gitignore.”,注意前后都有一个点.保存之后系统会自动重命名为“.gitignore”. 一般来说每个Git项目中都需要一个“.gitignore”文件,这个文件的作用就是告诉Gi