亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Do you dare to think about synchronizing game configuration file archives to Git?
伊謝爾倫
伊謝爾倫 2017-05-02 09:44:06
0
2
760
標(biāo)題黨,其實(shí)我是想請教一下Git的相關(guān)問題

Approximate requirements


I have a game folder, the approximate directory structure is as follows.

Game Directory XxxGames/

  • Folder Plugin

    • Some files

  • Folder Data

    • Some files

  • Folder Save

    • Some archives

  • Some files .exe/.log etc. in the root directory

My operations


  1. Under XxxGames $ git init

  2. Then $ git remote add coding http://url.git

  3. Created a new .gitignore file in the directory to exclude some files

  4. $ git add .

  5. $ git commit -m "first commit"

  6. $ git push coding master

  7. The push was successful, but some directories and files did not need to be synchronized

  8. So I modified .gitignore to exclude unnecessary directories and files again

  9. When $ git add . and commit, why not exclude the file I just updated and just update .gitignore

Detailed questions


  1. What are the specific steps to synchronize an existing local folder (project) to git.

  2. After push, modify u.gitignore, then add and then commit. Why not exclude the exclusion I just modified?

伊謝爾倫
伊謝爾倫

小伙看你根骨奇佳,潛力無限,來學(xué)PHP伐。

reply all(2)
小葫蘆

First of all, the first question, the specific steps are also very simple, roughly the following steps:

  • Initialize warehouse

git init
  • Add gitignore file

  • Check the status of the files in the warehouse. Here you can see whether the files that should be ignored are ignored and whether the files that should be added can be seen

git status -s
  • Add to staging area

git add .
  • Submit

git commit -m "commit message"
  • Add remote warehouse

git remote add origin <url of remote repository>
  • Push to remote warehouse

git push -u origin master

The origin in the above command can be specified at will, it is just customary to write it like this.
Then there is the second problem. This is because those files have been tracked before, and modifying .gitignore again will not take effect (this seems to be a known bug of git). The best way to solve this problem is: if you have just made some modifications, submit these modifications first, and then run the following command:

git rm -r --cached .
git add .
git commit -m "gitignore已經(jīng)生效"
過去多啦不再A夢

So I modified .gitignore to exclude unnecessary directories and files again

You need to delete it first and then commit it. Next time you add a file, ignore will take effect

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template