There is a workspace folder, which contains four folders a, b, c, and d
Suppose there is a project named c on my github
I git init directly in the c folder under the workspace, and then git clone the c project on github
This creates another c folder, which is very troublesome
If you git init directly in the workspace, there will be only one c folder.
But I am afraid to push the files a, b, and d to github later. .
Is there such a good way?
Does everyone create a warehouse directly under the workspace, and then write gitignore rules to filter a, b, d?
You can see that the last parameter is the directory name.
Don’t understand what you mean?
I directly git clone the corresponding project address to the workspace. Is there any problem with this? I don’t quite understand?
Look carefully at lz’s description, there is a folder dir under the workspace.
Can you try this?
The mac file system is not case-sensitive.There are two folders dir and dir in the repositroy.
Then you can do it locallygithub will display two folders, and when you clone it, only dir may be displayed.
If you don’t want to put other files
push
上去,就用.gitignore
过滤掉。你说的直接在c文件夹下git init
会多出来c文件,你可以直接服务器上的c文件夹内容pull
into the local c folder, wouldn’t it be fineUse the command in the c folder under the workspace folder
In this way, your local c folder will be synchronized to the remote github repository
If there is already a remote library and there are few new contents in the c project folder in the workspace, please do the following:
Delete the
c
project folderClone from the remote repository:
git clone http://your.github.com/c.git c
After the command is executed, the remote repository will be copied to the local directory, which means that the c folder at this time is already the local repository and has nothing to do with the a, b, d folders.
All
git
can be executed in thegit
在c
folder.Reference tutorial: Liao Xuefeng’s git tutorial-remote warehouse