10

How do I move my current work to a subject branch?

 2 years ago
source link: https://www.codesd.com/item/how-do-i-move-my-current-work-to-a-subject-branch.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How do I move my current work to a subject branch?

advertisements

I started on a simple task in the main branch. ya' know the type of task where "this is too simple even to bother with a git branch"... the inevitable result was that now I have a lot of unfinished work in the master branch and need to work on other things. How do I move my current work to a new branch?


You can switch branches with a dirty tree, as long as the switch doesn't involve modifying dirty files. Since you're creating a new branch it's guaranteed not to:

git checkout -b new-branch

Once you've done that you can commit and switch back to master. You can also commit first, although it's slightly more work, because you need to rollback master to before the commit:

git commit
git branch new-branch
git reset --hard HEAD^

Tags git

Related Articles

How do I display the current name of the git branch at the top of the page on my development website?

Here's my situation: I develop locally on my Mac using MAMP (PHP). My sites are under Git version control, and I point my dev servers to the root of the site under version control on disk. File structure: --mysitehere/ ---.git/ (.git folder is here v

How do I get the current Urban URL on a branch without rendering?

In twig I need to get the current full uri (url + uri ) without render it it like path('route_test', {param1:1}) How to get it ?Try to use : {{ app.request.uri }}

How to get the absolute path of the current working directory in Objective-C?

How do I get the current working directory's absolute path on the iPhone using Objective-C?I'm afraid that you can't get the absolute path on device, at least with official SDK. Please make me correct if I'm wrong.

How do I move content from my master branch to a new Git branch?

I've been making some vast changes on the master branch of my Git repository. I'm pretty new to Git and so I'm wondering: How can I move my current master branch to a new branch and recreate my master branch from scratch for a particular folder of fi

Change the current working directory to C ++

How can I change my current working directory in C++ in a platform-agnostic way? I found the direct.h header file, which is Windows compatible, and the unistd.h, which is UNIX/POSIX compatible.The chdir function works on both POSIX (manpage) and Wind

Get the current working directory in the kernel code

I am working on a project in which I need to know the current working directory of the executable which called the system call. I think it would be possible as some system calls like open would make use of that information. Could you please tell how

Change the current working directory in Java?

How can I change the current working directory from within a Java program? Everything I've been able to find about the issue claims that you simply can't do it, but I can't believe that that's really the case. I have a piece of code that opens a file

Java: How to prevent 'systemId' in EntityResolver # resolveEntity (String publicId, String systemId) from being absolutized to the current working directory

I want to parse the following XML document to resolve all entities in it: <!DOCTYPE doc SYSTEM 'mydoc.dtd'> <doc>&title;</doc> My EntityResolver is supposed to fetch the external entity with the given system ID from the database and

PHP: How to configure the current working directory to be the same as the directory running the script

I'm in the process of transferring my website from one server to another. I have some php scripts that use the is_readable function which uses the current working directory. On the old server, when I call getcwd(), it outputs the folder in which the

How can I ensure that resque worker processes other tasks while the current job is sleeping?

Each task I have work in a short bursts, then sleep for about an hour and then work again and so on until the job is done. Some jobs may take about 10 hours to complete and there is nothing I can do about it. What bothers me is that while job is slee

How do I import a Python library from the current working directory?

This question already has an answer here: Import python package from local directory into interpreter 6 answers I'm writing an installation program that will pull a script out of an existing Python file and then use it in the main Python program. Wha

How do I get the name of the current working directory (current working folder) instead of the path name?

I know how to get CWD's path name through the getcwd function , and I'm using the strtok function to get the directory name(means current working folder) , is there anything available to get this thing through a simple query or a function?If getcwd()

How to change the current working directory in a bash script on Mac OS X?

I'm struggling with a little problem, I never wrote a bash script before and it may be a little thing for someone who knows how it's done correctly. I have the following folder structure (cannot be changed): MyApp.app |_Contents |_Java |_MyApp.jar |_

In gnuplot for Windows, how can I list the files in the current / work directory?

I am running gnuplot version 4.6 (patchlevel 0) for Windows. The Windows version of this program provides a console or command prompt interface, similar to a bash shell in Unix/Linux or the DOS Command Prompt in Windows. Some commands in gnuplot for

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK