我在创建和访问我的第一个git存储库时遇到问题。我正在遵循前端Javascript框架:有关Coursea的Angular课程,并且遇到了一些问题。主要问题似乎是当Git尝试访问我要编辑的文件时,权限被拒绝。有人知道如何解决这个问题吗?
$ git init
Reinitialized existing Git repository in C:/Users/megan/.git/
$ git status
warning: could not open directory 'Application Data/': Permission denied
warning: could not open directory 'Cookies/': Permission denied
warning: could not open directory 'Documents/My Music/': Permission denied
warning: could not open directory 'Documents/My Pictures/': Permission
denied
warning: could not open directory 'Documents/My Videos/': Permission denied
warning: could not open directory 'Local Settings/': Permission denied
warning: could not open directory 'My Documents/': Permission denied
warning: could not open directory 'NetHood/': Permission denied
warning: could not open directory 'PrintHood/': Permission denied
warning: could not open directory 'Recent/': Permission denied
warning: could not open directory 'SendTo/': Permission denied
warning: could not open directory 'Start Menu/': Permission denied
warning: could not open directory 'Templates/': Permission denied
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
.bash_history
.gitconfig
3D Objects/
AppData/
Contacts/
Downloads/
Favorites/
IntelGraphicsProfiles/
Links/
MicrosoftEdgeBackups/
Music/
NTUSER.DAT
NTUSER.DAT{1c3790b4-b8ad-11e8-aa21-e41d2d101530}.TM.blf
NTUSER.DAT{1c3790b4-b8ad-11e8-aa21-e41d2d101530}.TMContainer00000000000000000001.regtrans-ms
NTUSER.DAT{1c3790b4-b8ad-11e8-aa21-e41d2d101530}.TMContainer00000000000000000002.regtrans-ms
OneDrive/
Saved Games/
Searches/
Videos/
ntuser.dat.LOG1
ntuser.dat.LOG2
ntuser.ini
nothing added to commit but untracked files present (use "git add" to track)
答案 0 :(得分:0)
首先,您可以删除from bs4 import BeautifulSoup
case_1 = '''<table><tr>
<th class="th" colspan="1">3 Months Ended</th>
<th class="th" colspan="1"></th>
</tr>
<tr>
<th class="th"><div>Mar. 31, 2018</div></th>
<th class="th"><div>Dec. 31, 2017</div></th>
<tr class="ro">
<td class="pl " style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_LongTermDebt', window );">Long-term debt</a></td>
<td class="nump">data for important date<span></span> #<- important data is 1st
</td>
<td class="nump">unimportant data<span></span>
</td>
'''
case_2 = '''
<table>
<tr>
<th class="tl" colspan="1" rowspan="1"><div style="width: 200px;"><strong>Condensed Consolidated Balance Sheets - USD ($)<br> $ in Thousands</strong></div></th>
<th class="th"><div>Mar. 31, 2018</div></th>
<th class="th"><div>Dec. 31, 2017</div></th>
</tr>
<tr class="ro">
<td class="pl " style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_InventoryNet', window );">Inventories, net</a></td>
<td class="nump">76,579<span></span>
</td>
<td class="nump">92,376<span></span>
</td>
</tr>'''
soup1 = BeautifulSoup(case_1, 'lxml')
soup2 = BeautifulSoup(case_2, 'lxml')
def get_data(soup):
return [[row_data.text.strip() for row_data in tr.select('td, th')[-2:]] for tr in soup.select('tr')[-2:]]
print('Case 1:')
for i, (date, data_for_date) in enumerate(zip(*get_data(soup1)), 1):
print('{}.\t{} - {}'.format(i, date, data_for_date))
print('\nCase 2:')
for i, (date, data_for_date) in enumerate(zip(*get_data(soup2)), 1):
print('{}.\t{} - {}'.format(i, date, data_for_date))
文件夹:它不属于此处,因为它会迫使Git考虑许多它无法访问的系统管理的子文件夹。
第二,使用不存在的文件夹初始化一个新的Git存储库
Case 1:
1. Mar. 31, 2018 - data for important date #
2. Dec. 31, 2017 - unimportant data
Case 2:
1. Mar. 31, 2018 - 76,579
2. Dec. 31, 2017 - 92,376
在该文件夹中(C:/Users/megan/.git
旁边为空),您可以开始创建文件cd C:/Users/megan
git init newRepo
cd newRepo
,.git/
请参见git init
:
如果提供目录,该命令将在其中运行。
如果该目录不存在,将创建它。