Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joefiorini/git-save
https://github.com/joefiorini/git-save
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/joefiorini/git-save
- Owner: joefiorini
- Created: 2013-01-15T01:43:18.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-16T21:45:05.000Z (about 12 years ago)
- Last Synced: 2024-11-16T16:29:33.610Z (2 months ago)
- Language: Shell
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
Ever had to stop working in the middle of a feature? Who hasn't? You don't want to push that shit to master. How about creating a quick WIP (work in progress) branch to hold that commit? We can do it in just a few commands:
```bash
git add -A .
git commit -m "WIP"
git push remote +head:WIP
git reset head^
```Let's walk through this:
1. Stage all files for commit
2. Commit with the message "WIP"
3. Push the head of your current remote to the branch called WIP (the `+` forces the push if WIP isn't inline)
4. Reset back to the previous commit, but leave all changes in place in the working directoryNeed to continue working on another machine?
```bash
git fetch
git cherry-pick origin/WIP
git reset head^
```1. Download the contents of the remote repo without applying it to your local branches
2. Get the last commit from origin/WIP (the one you pushed earlier)
3. Reset back to the last commit leaving all changes in placeThat's pretty simple, but wouldn't it be nice to have one command for each task?
## NOW YOU CAN!!
`git-save` gives you two commands to automate the above. When you want to save your work to a wip branch just run:
```
git save
```git will push your changes to the branch and keep your working directory like you never committed. When you're ready to pick up on another machine, just run:
```
git load
```and git will pull your latest save and apply to the working directory without any superfluous commits. It's beautiful.
## Configuration
By default, `git-save` will save to/load from `origin/wip`. You can change this by running:
```
git config save.remote origin
git config save.branch
```You can add the `--global` flag if you want to set the remote or branch for all of your repos.
### Contributions
Contributions are welcome. Please be kind and branch before you pull request.