GIT Knowledge Point Collation

Source: Internet
Author: User
Tags chmod commit file permissions
1, when you need to modify the project file permissions, but also worry about the changes caused by local and online file conflicts, what to do. You can use Git config core.filemode false and then use Cat. Git/config

OK, then you can chmod modify permissions. 2, view branch git branch-r list remote branch git branch-a list local branch and remote branch git branch create a new local branch, note that this is just creating a branch, without branching git branch-m | -M Oldbranch newbranch

Rename the branch, if the Newbranch name branch already exists, you need to use-m to force the rename, otherwise, use-m to rename git branch-d | -D branchname Delete branchname branch git branch-d-r branchname Delete remote Branchname branch git checkout-b mybranch create and switch branches git checkout my Branch Switch Branch 3, git add encounters git warning:lf'll be replaced by CRLF in

The line break in Windows is CRLF, and the newline character under Linux is LF, so the add is executed. When the prompt appears, the workaround:

Can do this: git config Core.autocrlf false 4, the first time to upload a local project to the remote git init

Initializing a git repository git add under the Gitstore directory

Copy a file into the Gitstore directory, and then execute git Add.

Store "Modify" from the current workspace to staging area git commit-m "First commit"

Submit files stored in staging area to the Git repository

Create a new Git codebase at the remote location: Git remote add Origin https://coding.com/zhfei/iOS-my-CodeSnippets.git

To associate the current branch of the local code base with a remote code base GIT push-u Origin Master

Pushes the current branch of the local code library to the remote code base

Another: Command supplement.

View the address of the remote code base of the Git repository: git remote-v 5,git settings Remember user name and password

cd. Git 

vim config

add

 [credential]

        helper = Store

What to do if you need to modify the project file permissions, but also worry about the changes that cause local and online file conflicts.

You can use git config core.filemode false

Then use Cat. Git/config

OK, then you can chmod modify permissions. 6. Git pull appears: Reject merge unrelated historical Git pulling Origin master–allow-unrelated-histories 7. Git ignores invalid workarounds for files that have been included in version management

Adding some directories or files to the ignore rule, as defined in the above method, is not effective because the. Gitignore can only ignore files that have not been traced, and if some files have already been included in version management, modify the. Gitignore is not valid. The solution is to delete the local cache (which is not being traced) before committing: git rm-r–cached.
git Add.
git commit-m ' update. Gitignore '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.