What is GIT?
gitis a distributed version control system used to track changes in computer files and coordinate work among multiple files.
githubis a web hosting service that supports projects using Git.
Uploading a Git Project #
Create a repository + remember the address
Perform initial setup.
git config --global user.name "NAME"
git config --global user.email "EMAIL"
- Prepare files
git init # Create git files
git add . # Manage all files within the selected project folder
git status # Check status
git commit -m '내용' # Commit
- Upload
git remote add origin 리퍼지토리주소
git push origin master
- Done
Updating a Git Repository #
- Used when initial setup is complete and you want to update
git add .
git commit -m '커밋메시지'
git push origin master
You can check the current status by typing
git status.
Collection of Git Commands (a few only) #
Commands mentioned above are omitted.
clone #
git clone URL // Clone repository, download
git clone /로컬/저장소/경로 // Clone local repository
commit #
$ git add <파일명>
$ git add * // Include changes of a single file in the commit
branch #
$ git branch // List branches
$ git branch // <브랜치이름> Create a new branch (locally)
$ git checkout -b // <브랜치이름> Create & switch to a branch
$ git checkout master // Switch back to master branch
push #
$ git push origin master // Upload changes to remote server
$ git push < remote > // <브랜치이름> Upload commits to remote server
$ git push -u < remote > // <브랜치이름> Upload commits to remote server