Integrates Git with Sublime 3 to pull or push to Github by using Sublime plugin Git
2017-10-26 17:37
459 查看
1. Git must be installed, Sublime plugin "Git" only connects Sublime with Git.
Download URL
https://git-scm.com/downloads
2. Enable Sublime 3 Package Control, which is a sublime package manage tool
Ctrl+Shift+P
Install Package Control
3. Install Package (Plugin) "Git"
Ctrl+Shift+P
Install Package -> Search "Git", then install
4. After installed, most of Git Cmd could be issued from follow operation
Ctrl+Shift+P
Type "Git: "
5. The common operations as below
1). Git: Init --> Initialize current directory as Git Directory
2). Git: Add All --> Add all changed files to staging area, Git: Add Current File --> To add current file into staging area.
3). Git: Commint --> Add staged files to commit area. It will promt another page to add commit message. This page will show all code hunks that will be part of this commit. Add a commit message and close the file to commit files.
4). Git: Push Current Branch --> Push Changes to remote origin. will push your local committed changes to associated remote repository. This command will give error in sublime console if remote repository is not associated with local repo.
Open Git at Windows CMD, try to make a remote repo.
git remote add origin https://github.com/username/reponame.git
5). Git: Pull Current Branch --> Pull changes from remote origin
After making remote repo, we can Push to Github and Pull from Github
Notes: When using git pull, there will be an error -->
Open Git at Windows CMD, try to pull from remote repo with a parameter
git pull origin master --allow-unrelated-histories
Then it's able to pull from sublime
6). Git: Diff All Files --> will show all changes in the code which are not committed. This will open up new window which is showing all the changes in the code hunks.
7). Git: Log All --> Will prompt to select the list of previous commit. Once you select specific commit, it will show log of all changes happend in that commit.
Notes: If you occurred any problem when running GIT commands at Sublime, you just need to run the GIT commands at terminal / Windows CMD successfully, then you can run the GIT commands at Sublime without errors.
Ref:
1. http://smoothprogramming.com/sublime-text/how-to-use-git-in-sublime-text/
2. https://stackoverflow.com/questions/37937984/git-refusing-to-merge-unrelated-histories
Download URL
https://git-scm.com/downloads
2. Enable Sublime 3 Package Control, which is a sublime package manage tool
Ctrl+Shift+P
Install Package Control
3. Install Package (Plugin) "Git"
Ctrl+Shift+P
Install Package -> Search "Git", then install
4. After installed, most of Git Cmd could be issued from follow operation
Ctrl+Shift+P
Type "Git: "
5. The common operations as below
1). Git: Init --> Initialize current directory as Git Directory
2). Git: Add All --> Add all changed files to staging area, Git: Add Current File --> To add current file into staging area.
3). Git: Commint --> Add staged files to commit area. It will promt another page to add commit message. This page will show all code hunks that will be part of this commit. Add a commit message and close the file to commit files.
4). Git: Push Current Branch --> Push Changes to remote origin. will push your local committed changes to associated remote repository. This command will give error in sublime console if remote repository is not associated with local repo.
Open Git at Windows CMD, try to make a remote repo.
git remote add origin https://github.com/username/reponame.git
5). Git: Pull Current Branch --> Pull changes from remote origin
After making remote repo, we can Push to Github and Pull from Github
Notes: When using git pull, there will be an error -->
fatal: refusing to merge unrelated histories
Open Git at Windows CMD, try to pull from remote repo with a parameter
git pull origin master --allow-unrelated-histories
Then it's able to pull from sublime
6). Git: Diff All Files --> will show all changes in the code which are not committed. This will open up new window which is showing all the changes in the code hunks.
7). Git: Log All --> Will prompt to select the list of previous commit. Once you select specific commit, it will show log of all changes happend in that commit.
Notes: If you occurred any problem when running GIT commands at Sublime, you just need to run the GIT commands at terminal / Windows CMD successfully, then you can run the GIT commands at Sublime without errors.
Ref:
1. http://smoothprogramming.com/sublime-text/how-to-use-git-in-sublime-text/
2. https://stackoverflow.com/questions/37937984/git-refusing-to-merge-unrelated-histories
相关文章推荐
- How to automate PowerPoint by using Visual C++ 5.0 or Visual C++ 6.0 with The Microsoft Foundation Classes
- How to set up CI System by Jenkins +Maven+Sonar with git
- Step-By-Step Guide to Get Started with Salesforce REST API using Java
- git push fatal: unable to connect to github.com问题
- 提示git error: failed to push some refs to 'git@github.com:
- git在pull时 Error pulling origin: error: Your local changes to the following files would be overwritten by merge
- Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found. <a href="openFile:D:\Git
- 【Github】fatal: remote error: You can't push to git 解决办法
- error: failed to push some refs to 'git@github.com:....." Updates were rejected because the remote c
- 芒果iOS开发之Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
- git push报错error: failed to push some refs to 'git@github.com:
- USING GIT AND GITHUB TO MANAGE YOUR DOTFILES
- “Nothing to push” error in Android studio with Git
- how to do error handing with WCF by using attributes to log your errors z
- Windows下Git push or pull免输入密码设置
- Adobe--Without using /,% ,+and * operators. write a function to check whether a number is divisible by 3 or nor?
- github 提交代码 failed to push some refs to git
- 解决本地项目上传到github时$git push -u origin master error failed to push some refs...等错误
- 【已解决】github中git push origin master出错:error: failed to push some refs to