New at Git .. please give suggesstion - asp.net-mvc

I have MVC project which was already on git or in git whatever i don't know. Than i formatted my PC and than again install Git. but I don't know How actually it works. i gone through many tutorials and blogs but it is not happening.
As my project was already in GIT. so i have .git folder in my Project. and also have .gitignore file.
which have following data:
## 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
My project folder resides in F:/MarketPlace/MarketPlace path.
And I written following Commands in 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
Now what should i do for my project to be run.

If your .git folder is usable, you should see the name of the branch in git bash upon changing your directory to the folder where .git is located. You should not need to execute the 'git init' command, since this will create a new .git folder. It sounds like what you want to do is recover the existing repository, so we need to determine if your previous .git folder contains anything valuable.
Also, .gitignore is the file where you can specify files that should not be included in changesets.
Try navigating to 'C:Users/sadhana/' and see if git bash picks up on the repository in the .git folder. You'll see the name of the branch if it goes well :)

Related

How to remove files from git by adding in .gitignore using visual studio 2019?

I'm using an ASP.NET MVC application and I have added my source code to git bitbucket repository.
All my source code has been enabled to get tracking and history.
I had added .gitignore in the very first version of my source code but very less changes.
Now i need to skip my bin and other unnecessary files ( like .cache and .host).
I have added all unnecessary files in .gitignore.
Please see my tried .gitignore file
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*[.json, .xml, .info]
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# 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
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# 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
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
Application built with
{
"application type": "ASP.NET MVC 5",
".Net framework": "4.5" ,
"language" : C#
}
I have removed the cached files as well by executing the following commands through git bash.
I have pulled all source again.
git rm -r --cached
git add .
git commit -m ".gitignore fix"
I have confirmed that my .gitignore is in the root of the working directory.
What should I do to fix it ?
I tried to follow google articles and looked up example implementations but could not solve/explain the issue well.

.gitignore for umbraco, including user-specific data

Using visual studio and the Umbraco NuGet package, I'd like to setup a basic Umbraco installation containing:
some umbraco packages, such as Optimus
some individual document types
This should be wrapped by a git repo.
Where possible, I'd like to exclude generated/compiled files by adding the affected paths/file extensions to the .gitignore file.
I started off using the official umbraco .gitignore which has the following entries:
# Note: VisualStudio gitignore rules may also be relevant
# Umbraco
# Ignore unimportant folders generated by Umbraco
**/App_Data/Logs/
**/App_Data/[Pp]review/
**/App_Data/TEMP/
**/App_Data/NuGetBackup/
# Ignore Umbraco content cache file
**/App_Data/umbraco.config
# Don't ignore Umbraco packages (VisualStudio.gitignore mistakes this for a NuGet packages folder)
# Make sure to include details from VisualStudio.gitignore BEFORE this
!**/App_Data/[Pp]ackages/
!**/[Uu]mbraco/[Dd]eveloper/[Pp]ackages
# ImageProcessor DiskCache
**/App_Data/cache/
However, this would not include the database nor installed packages, so I also added the following entries*:
!**/Aa]pp_[Dd]ata/packages
!**/Aa]pp_[Dd]ata/Umbraco.sdf
!**/[Bb]in/*.pdb
!**/[Uu]mbraco/[Cc]onfig
see discussion here
Using this configuration, ReSharper would list 3 errors which occur in the global web.config file:
my-umbraco-project\Web.config:87 Cannot resolve symbol 'Providers'
my-umbraco-project\Web.config:87 Cannot resolve symbol 'DefaultSessionStateProvider'
my-umbraco-project\Web.config:87 Invalid module qualification: Failed to resolve assembly System.Web.Providers
However, I can compile, log-in to my umbraco instance and even the pre-installed plugin would appear.
This basically leaves 2 questions:
What do I additionally have to include in order to fix the 3 errors?
Are there more compiled/generated files I could exclude?
So here's the .gitignore we use without any issues:
[Oo]bj/
[Bb]in/
.nuget/
.vs/
_ReSharper.*
packages/
artifacts/
*.user
*.suo
*.userprefs
*.dbmdl
*DS_Store
*.sln.ide
# Umbraco
# Ignore unimportant folders generated by Umbraco
**/App_Data/Logs/
**/App_Data/[Pp]review/
**/App_Data/TEMP/
**/App_Data/NuGetBackup/
# Ignore Umbraco content cache file
**/App_Data/umbraco.config
# Don't ignore Umbraco packages (VisualStudio.gitignore mistakes this for a NuGet packages folder)
# Make sure to include details from VisualStudio.gitignore BEFORE this
!**/App_Data/[Pp]ackages/
!**/[Uu]mbraco/[Dd]eveloper/[Pp]ackages
!*UmbracoModelsBuilder.user
# ImageProcessor DiskCache
**/App_Data/cache/

Howto publish a git repository with ruby as zipfile

I am using OpenProject as project management software and I am not very familiar with ruby and rails, but using the gitolite-plugin works quite well.
I am looking for a solution to provide a link to the OpenProject users where they can directly download the gitolite-hosted repository as a zipfile.
Is that possible ?
I am willing to put pieces of code together, so even partially solutions and hints are welcome.
thx.
Nothing in oliverguenther/openproject-revisions_git would do a :
git bundle (full repo history in one file)
git archive (latest working tree as one zip file)
You would need to extend that plugin in order to expose that feature, implementing a ruby function to call git-archive on the right project, a bit like in this gist:
(extract)
# Runs the `git archive` command to pull your repository out
# into a tar or tar.gz and writes it to a temporary directory
#
# Args:
# * path - path within the repository to archive, defaults to the root
#
# Returns the path to the tar file
def archive(path=nil)
#archive_path = path || ''
create_tmp_directory
#tar_path = "#{#tmp_directory_path}/archive.tar#{#gzip}"
Dir.chdir #path
puts "Archived repository" if run_shell_cmd "git archive --prefix=#{#archive_path}/ #{#branch}:#{#archive_path} -o #{#tar_path}" and #verbose
Dir.chdir #pwd
#tar_path
end

Dart: default gitignore?

I created a new app and the Dart Editor (M4) created a slew of files and folders. Now I'm not sure which I can safely put in the gitignore. Here's the tree:
app/.buildlog
app/build.dart
app/packages/analyzer_experimental
app/packages/args
app/packages/browser
app/packages/csslib
app/packages/html5lib
app/packages/js
app/packages/logging
app/packages/meta
app/packages/pathos
app/packages/source_maps
app/packages/unittest
app/packages/web_ui
app/pubspec.lock
app/pubspec.yaml
app/web/app.css
app/web/app.dart
app/web/app.html
app/web/out/app.css
app/web/out/app.dart
app/web/out/app.dart.map
app/web/out/app.html
app/web/out/app.html_bootstrap.dart
app/web/out/packages
app/web/out/xclickcounter.dart
app/web/out/xclickcounter.dart.map
app/web/packages
app/web/xclickcounter.dart
app/web/xclickcounter.html
I assume the following files can be ignored:
app/.buildlog
app/packages/*
app/web/out/*
app/web/packages
Is that correct?
From What Not to Commit on dartlang.org:
# files and directories created by pub
.dart_tool/
.packages
.pub/
build/
pubspec.lock # Except for application packages
# API documentation directory created by dartdoc
doc/api/
# files and directories created by other development environments
*.iml # IntelliJ
*.ipr # IntelliJ
*.iws # IntelliJ
.idea/ # IntelliJ
.DS_Store # Mac
# generated JavaScript files
*.dart.js
*.info.json # Produced by the --dump-info flag.
*.js # When generated by dart2js. Don't specify *.js if your
# project includes source files written in JavaScript.
*.js_
*.js.deps
*.js.map
Don’t commit the following files and directories created by pub, Dart Editor, and dart2js:
packages/
pubspec.lock // Except for application packages
.project
.buildlog
*.js_
*.js.deps
*.js.map
Don’t commit files and directories dropped by other development environments. For example:
.project // Eclipse
*.iml // IntelliJ
*.ipr // IntelliJ
*.iws // IntelliJ
.idea/ // IntelliJ
.DS_Store // Mac
Avoid committing generated JavaScript files:
*.dart.js
For more details, read https://www.dartlang.org/tools/private-files.html.
Dart default
.packages # mapping file from package names to local path
packages # until `--no-package-symlinks` is the default
build/ # contains the output of `pub build`
.pubspec.lock # controversial - Dart guideline is to only commit
# for applications but not for packages
.pub/ # cache files generated by `pub`
# .pub was moved to .dart_tool/.pub
build The new https://github.com/dart-lang/build package introduces a
.dart_tool/
directory which should be excluded.
When it comes to generated files it is generally best to not submit them to source control, but a specific Builder may provide a recommendation otherwise.
IDE
.idea # IntelliJ, WebStorm
bazel
/bazel-*
.bazelify
packages.bzl
BUILD
WORKSPACE
See also
https://github.com/github/gitignore/blob/master/Dart.gitignore
https://www.dartlang.org/guides/libraries/private-files
An up to date sample Dart .gitignore is available in the gitignore repo on Github:
https://github.com/github/gitignore/blob/master/Dart.gitignore
Note that this does not contain IDE or editor files, just Dart files. You can find IDE and editor .gitignores in the same repo.
I include doc/api in my .gitignore. I tend to write substantial documentation comments and I like to use dartdoc to generate the documentation for review.

git and ASP MVC

Anyone know of good articles for setting up a new project with git and ASP.NET MVC?
Just wondering what to include and ignore and what to do about deployment.
Gitignore
You asked about what to ignore -- here is my default .gitignore for ASP.NET MVC projects:
###################
# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache
*.suo
# Include dlls if they’re in the NuGet packages directory
!/packages/*/lib/*.dll
!/packages/*/lib/*/*.dll
# Include dlls if they're in the CommonReferences directory
!*CommonReferences/*.dll
####################
# VS Upgrade stuff #
####################
UpgradeLog.XML
_UpgradeReport_Files/
###############
# Directories #
###############
bin/
obj/
TestResults/
###################
# Web publish log #
###################
*.Publish.xml
#############
# Resharper #
#############
/_ReSharper.*
*.ReSharper.*
############
# Packages #
############
# it’s better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
######################
# Logs and databases #
######################
*.log
*.sqlite
# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
Setting up a new project
For help on setting up a new project, I would install msysgit since you're most likely on Windows and check out learn.github to learn about getting started with git.
Of course, the master (Skeet) suggests you do most everything from the console -- and I tend to agree with him. Git is just easier that way IMHO. If you'd like a handy git reference, check out the git reference.
Deployments
As somebody else already mentioned -- check out AppHarbor for deployments. Those guys aim to be the 'Heroku of ASP.NET'.
There is a great post on codebetter.com today. It is about OSS projects but I bet it is applicable to you as well because it is describing GIT.
The right part of the article is the link to Kyle's blog and especially Getting Started with Git and GitHub on Windows.
If you're already using git and ASP MVC you should also check out AppHarbor http://appharbor.com/ for deployment and hosting. It integrates right into your workflow.
Corrected link
http://codebetter.com/blogs/aaron.jensen/archive/2009/03/12/hosting-your-oss-project-on-github.aspx
Mine is super simple:
*/packages/*
/packages/*
obj/
bin/
TestResults/
_ReSharper.*
*.csproj.user
*.resharper.user
*.resharper
*.suo
*.cache
*~
*.swp
*.resharper.user
*.rptproj.user
*.db
*.sdf
*.tmp
For the example of gitignore files check github gitignore examples and one for visual studio VisualStudio.gitignore

Resources