git clone followed by status shows untracked files

后端 未结 4 453
感动是毒
感动是毒 2021-02-05 09:22

Sorry, I\'m a git newbie (though I\'m very familiar with older source control systems like cvs and svn) ...

My ultimate goal is to add a file to a remote repository (one

相关标签:
4条回答
  • 2021-02-05 09:36

    git config -l

    if current git repository's core.precomposeunicode=true

    try this,

    git config core.precomposeunicode false

    and this is why. from here

    core.precomposeunicode This option is only used by Mac OS implementation of Git. When core.precomposeunicode=true, Git reverts the unicode decomposition of filenames done by Mac OS. This is useful when sharing a repository between Mac OS and Linux or Windows. (Git for Windows 1.7.10 or higher is needed, or Git under cygwin 1.7). When false, file names are handled fully transparent by Git, which is backward compatible with older versions of Git.

    0 讨论(0)
  • 2021-02-05 09:40

    Git is a wonderful tool, but it's easy to get lost without a good map of where you are in the forrest of commits.

    Here's how to get that map (I call it "gr" for "graph", but you could also call it "map" if you prefer):

    git config --global alias.gr 'log --graph --full-history --all --color --decorate'
    

    That's a one-time setup for git. Now whenever you're lost, just take a look at the map:

    git gr
    

    Your current location is denoted by the word "HEAD", and any branch names are also listed.

    You'll see that you're currently not on any branch, which sounds a lot worse than it really is -- it's actually no big deal, it just means your commits won't go into the master branch the way you want them to.

    So just get back on your master branch and commit there:

    git checkout master
    git add yourfile.txt
    git commit -m'Narg'
    git push
    

    Also take a look at git gr now and you'll see that HEAD is at the same commit as master, and master is at the same commit as origin/master, which means you're all set.

    0 讨论(0)
  • 2021-02-05 09:54

    Another reason this might happen: files with a colon in the name that were created in the github webinterface: lost:time.txt

    0 讨论(0)
  • 2021-02-05 09:58

    For others who may reach here by google.

    I encountered the same issue - except that I was able to push and didn't get any "Everything up to date" message.
    The problem was that windows and mac OS, unlike linux, are case-insensitive; but repo had been created on a case-sensitive OS and had got two version of some files differing only in capital and small letters.

    There's an issue here about it.

    0 讨论(0)
提交回复
热议问题