Open mowatermelon opened 6 years ago
$ dotnet new mvc -o aspnetcoreapp
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once. Decompressing 100% 18674 ms Expanding 100% 73648 ms Failed to create prime the NuGet cache. restore failed with: 1 The template "ASP.NET Core Web App" was created successfully. This template contains technologies from parties other than Microsoft, see https://aka.ms/template-3pn for details.
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}"
);
});
这个应该不难解释。
如果你在当前文件夹中执行过 git remote add
,命令应该是
git remote add origin https://github.com/yourName/yourRepo.git
一般都会这么打。。这样一来,origin
就指向你的远程库。你可以试试,把 origin
从那条命令中去掉,应该会报错。如果你是用 git clone
把远程库 clone
了下来,那么应该是会自动帮你设置好 origin 指向。
但是有一点你要注意。。到目前为止说的 origin
不是仓库名。。而是给远程仓库在本地起的一个别名。
对于你的情况,你说要“github上新建远程仓库‘origin’”,我有一点儿懵==!仓库名,一般不会叫 origin
。。比如你的项目叫 Angular-Table, 那么你需要做的就是 git remote add origin https://github.com/yourName/Angular-Table.git
。这样一来,你就可以用 git push origin master
来推送更改了。
再说 branch
的事儿。git push origin master
意思就是,把你本地的 master branch
推送到远程 origin
。如果写成 git push origin master:foo
,意思就是把本地的 master branch
推送到远程的 foo branch
。
顺便,这里引出一个黑科技。。比如我想删除远程的foo branch
, 命令就是: git push origin :foo
你可以通过 git branch
来查看本地有什么branch
。也可以通过 git remote -v
来查看远程有什么 branch
。顺便,git remote -v
可以查看 remote
信息,去试试吧
$ git help
usage: git [--version] [--help] [-C <path>] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
These are common Git commands used in various situations:
start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize an existing one
work on the current change (see also: git help everyday)
add Add file contents to the index
mv Move or rename a file, a directory, or a symlink
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
examine the history and state (see also: git help revisions)
bisect Use binary search to find the commit that introduced a bug
grep Print lines matching a pattern
log Show commit logs
show Show various types of objects
status Show the working tree status
grow, mark and tweak your common history
branch List, create, or delete branches
checkout Switch branches or restore working tree files
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
merge Join two or more development histories together
rebase Reapply commits on top of another base tip
tag Create, list, delete or verify a tag object signed with GPG
collaborate (see also: git help workflows)
fetch Download objects and refs from another repository
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
git command upload files
step one
check local branch
$ git branch
* master
step two
check remote branch
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
step three
check origin
$ git remote show origin
* remote origin
Fetch URL: <your project remote respository git address>
Push URL: <your project remote respository git address>
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
# if you already set origin , you can jump to step four
# but you not set it
# you should setting origin before step four
$ git remote add origin git@github.com:<your github name>/<your remote branch project name>.git
# or
$ git remote add origin https://github.com/<your github name>/<your remote branch project name>.git
step four
add files to the cache
$ git add <you want to upload files path>
#for example
$ git add . # add all files
# or
$ git add 'learnframe/other/dotnet core/' # add specified files
# if warning: LF will be replaced by CRLF in xxx.xxx.
# The file will have its original line endings in your working directory.
# add a space with the end of command
# or
# execution $ git config core.autocrlf false
# and execution git add command
step five
add commit
$ git commit -m <you want to commit with upload files>
#for example
$ git commit -m ' commit dotnet core webTemplate'
step six
push files
$ git push origin <local_branch>:<remote_branch>
# if your all setting is right
$ git push
#for example,if local_branch equals remote_branch,you only need to write one name
$ git push origin master
Username for 'https://github.com': <your github name>
Password for 'https://<your github name>@github.com':<your github password>
Counting objects: 30, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (24/24), done.
Writing objects: 100% (30/30), 52.17 KiB | 0 bytes/s, done.
Total 30 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), completed with 2 local objects.
To <your local origin url>
d2e8223..cacacd6 master -> master
download vs themes setting
https://studiostyl.es/schemes/son-of-obsidian
download file name : "son-of-obsidian.vssettings"
Welcome to .NET Core!
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to s e available commands or go to https://aka.ms/dotnet-cli-docs.
Telemetry
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is coll cted by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environme t variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
Configuring...
A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute o complete and will only happen once. Decompressing 100% 19809 ms Expanding 100% 151372 ms Failed to create prime the NuGet cache. restore failed with: 1 Getting ready... No templates matched the input template name: razor.
Templates Short Name Language Tags
Console Application console [C#], F#, VB Common/Console Class library classlib [C#], F#, VB Common/Library Unit Test Project mstest [C#], F#, VB Test/MSTest xUnit Test Project xunit [C#], F#, VB Test/xUnit ASP.NET Core Empty web [C#], F# Web/Empty ASP.NET Core Web App mvc [C#], F# Web/MVC ASP.NET Core Web API webapi [C#], F# Web/WebAPI global.json file globaljson Config Nuget Config nugetconfig Config Web Config webconfig Config Solution File sln Solution