Git的新功能..请给出建议

时间:2015-11-28 06:19:10

标签: asp.net-mvc razor

我有MVC项目已经在git或git上,无论我不知道。比我格式化我的PC,然后再安装Git。但我不知道它究竟是如何运作的。我经历了很多教程和博客,但它没有发生。

因为我的项目已经在GIT中了。所以我的项目中有 .git 文件夹。并且还有 .gitignore 文件。

有以下数据:

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
x64/
build/
bld/
[Bb]in/
[Oo]bj/

# Roslyn cache directories
*.ide/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

#NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
 _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
## TODO: Comment the next line if you want to checkin your
## web deploy settings but do note that will include unencrypted
## passwords
#*.pubxml

# NuGet Packages Directory
packages/*
## TODO: If the tool you use requires repositories.config
## uncomment the next line
#!packages/repositories.config

# Enable "build/" folder in the NuGet Packages folder since
# NuGet packages use it for MSBuild targets.
 # This line needs to be after the ignore of the build folder
 # (and the packages folder if the line above has been uncommented)
!packages/build/

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/

# RIA/Silverlight projects
Generated_Code/

 # Backup & report files from converting an old project file
 # to a newer Visual Studio version. Backup files are not needed,
 # because we have git ;-)
 _UpgradeReport_Files/
 Backup*/
 UpgradeLog*.XML
 UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
/Marketplace/DesignTemplates/NC Tourism Beta/extractedfiles/backend/
/Marketplace/DesignTemplates/NC Tourism Beta/prod/backend/
*.bak
*.png
*.db
*.jpg

我的项目文件夹位于F:/ MarketPlace / MarketPlace路径中。 我在GItBash中编写了以下命令..

Sadhana@Viprak-Sadhana MINGW64 ~
$ cd..
bash: cd..: command not found

Sadhana@Viprak-Sadhana MINGW64 ~
$ git init
Initialized empty Git repository in C:/Users/Sadhana/.git/

Sadhana@Viprak-Sadhana MINGW64 ~ (master)
 $ .gitignore
bash: .gitignore: command not found

Sadhana@Viprak-Sadhana MINGW64 ~ (master)
$ cd C:Users/sadhana/.git

Sadhana@Viprak-Sadhana MINGW64 /c/Users/sadhana/.git (GIT_DIR!)
$ git init --bare marketplace.git
Initialized empty Git repository in C:/Users/Sadhana/.git/marketplace.git/

Sadhana@Viprak-Sadhana MINGW64 /c/Users/sadhana/.git (GIT_DIR!)
$ .gitignore
bash: .gitignore: command not found

现在该怎样做才能让我的项目运行。

1 个答案:

答案 0 :(得分:0)

如果您的.git文件夹可用,您应该在将目录更改为.git所在的文件夹时在git bash中看到分支的名称。你不应该执行' git init'命令,因为这将创建一个新的.git文件夹。听起来你想要做的是恢复现有的存储库,所以我们需要确定你以前的.git文件夹是否包含任何有价值的东西。

此外,.gitignore是您可以指定不应包含在更改集中的文件的文件。

尝试导航到' C:Users / sadhana /'并查看git bash是否在.git文件夹中的存储库中获取。如果分支顺利,您将看到分支的名称:)