Git commands to initial, add and commit files

 Author: Shengtao Zhou       Created: 4/6/2019 6:17:31 AM       Modified: 4/10/2019 10:57:20 PM   More...
When you add a huge amount of files to git, you can't really use Git UI tools, like "Git GUI", because it has 5000 files limits for each commit. Here's the command lines that should be used to initial Git repository and add all files:
Open command line, change current directory to the folder you want to create the repository. Run the following commands:

1) Init local repository

git init

2) Add all files

git add --all

3) Commit local repository

git commit -am <commit message>

4) Create a remote repository in github.com, then link remote repository to local repository

git remote add origin https://github.com/user/repo.git

5) Push local repository to remote repository

git push -u origin master

6) Pull from remote branch

If your local repository version is behind from the version in remote repository, push command will fail. So you need run following command first then push again.
git pull <remote repository url> <branch name>

7) Ignore files

Some files you may not want to checkin to Git, you can add them to an ignore file list.



More...          Back to List          

(Please enter you comments between 100 to 2000 characters. Thanks for your contribution.) 

         Created:       Modified: 

Editing a comment

       (Please enter you comments between 100 to 2000 characters. Please login before edit comment.)